OpenSTA logo OpenSTA SCL Reference
CALL Command

CALL Command

This command calls a subroutine from within a Script. Subroutines must follow the main code section and must not be embedded within it. They share the variable definitions of the main module.

It is not possible to branch in or out of a subroutine, because a label cannot be referenced outside of the main module or subroutine in which it occurs. This does mean, however, that each subroutine enables a Script to define up to 255 labels in addition to those used in the main code.

A maximum of 8 parameters may be passed from the calling code to the called subroutine. The parameters passed may be character or integer variables, literals, or quoted character strings. The calling code must pass exactly the same number of parameters to the called subroutine as the called subroutine has defined in its SUBROUTINE statement. The names of the variables in the call need not be the same as in the subroutine parameter list, but the data types of each of the parameters must match. Failure to comply with these conditions will result in a Script error being generated.

The values of the variables defined as parameters in the subroutine definition are not copied back to the variables in the call, on return from the subroutine. However, if the same variable names are used in the call and the subroutine parameter list, the value of the variable in the call will be changed by a change in the subroutine; this is because the calling code and the called subroutine share the same data definitions. Conversely, if different variable names are used, any changes made to variables within the subroutine will not affect the variables in the call.

Command Definition:

CALL subroutine {[parameter{, parameter ...}]}

subroutine

The name of the called subroutine. The name must be a valid OpenSTA Dataname.

parameter

A character variable, integer variable, integer value, or a quoted character string. Up to 8 parameters may be declared in the CALL command. There must be the same number of parameters in this list as are in the subroutine's definition, and the data types of the parameters must match.

Examples:

CALL DATE_CHECK
CALL CREATE_FULL_NAME[First-Name, Middle-Initial, Last-Name]

<<<
prev page
^^^
section start
>>>
next page