Previous Page | Next Page

Language Reference

START Statement

START <name> <(arguments)> <GLOBAL(arguments)> ;
language statements
FINISH <name> ;

The START statement defines the start of a module definition. Subsequent statements are not executed immediately, but are instead collected for later execution. The FINISH statement signals the end of a module definition.

The arguments to the START statement are as follows:

name

is the name of a user-defined module.

arguments

are names of variable arguments to the module. Arguments can be either input variables or output (returned) variables. Arguments listed in the GLOBAL clause are treated as global variables. Otherwise, the arguments are local.

module statements

are statements making up the body of the module.

When no name argument is given in the START statement, the module name MAIN is used by default. If an error occurs during module compilation, the module is not defined. See Chapter 6 for details.

The following example defines a module named MYMOD that has two local variables (A and B) and two global variables (X and Y). The module creates the variable Y from the arguments A, B, and X.

start mymod(a,b) global(x,y);
   y=a*x+b;
finish;

x = 1:4;
call mymod(2, 1);
print y;

Figure 23.220 Results of Calling a Module
Test of NLPHQN subroutine: No Derivatives

y
3 5 7 9

Previous Page | Next Page | Top of Page