Phantom Documentation

[Help Home] [Phantom Home]
package

Syntax:

package "sPackage";

Where,

sPackage - The name of the new function package

Description:
The package keyword declares a new package name. All user-defined functions added after the package statement will belong to the package 'sPackage'. Using what with a parameter 'sPackage' will show all the functions declared under the new user defined package.

Example Code

# Declare a new package
package "Sample Package";

# Declare some functions
function void f(int i){
  disp(i);
}

function void f(int j, int k){
  disp(j + k);
}

function void g(int n){
  disp(n*2);
}

# Show the new package is created
what();

# Show a list of functions
# in the new package
what("Sample Package");

 

See Also: Keywords, what


Copyright 2000-2011 Phantom Automated Solutions