Open System Testing Architecture

TOC PREV NEXT INDEX



CALL Command

Description:

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 into 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 eight 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.

Format:
 CALL subroutine {[parameter{, parameter ...}]}
Parameters:
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 [char_first,char_second,char_title]

See also:

Flow Control Commands


OpenSTA.org
Mailing Lists
Further enquiries
Documentation feedback
CYRANO.com
TOC PREV NEXT INDEX