Open System Testing Architecture

TOC PREV NEXT INDEX



SUBROUTINE Command

Description:

This command defines the start of a discrete section of code which is bounded by the SUBROUTINE and END SUBROUTINE commands.

Subroutines are called from the main code with a command of the format "CALL name". They return control to the main code by use of the RETURN command. A maximum of 255 subroutines may be defined within a script.

Subroutines share the same variable definitions as the main code but have their own labels. A label may not be referenced outside the main module or outside the subroutine in which it occurs. This has the effect of disabling branching into and out of subroutines, and also means that each subroutine may use a further 255 labels in addition to those used in the main code.

Format:
 SUBROUTINE name {[parameter{, parameter..}]}
Parameters:
name

The name of the subroutine. This must be a valid OpenSTA Dataname, and must be unique within the script.

parameter

A character variable or integer variable declared in the Definitions section of the script. Up to 8 parameters can be declared in the SUBROUTINE command. There must be the same number of parameters in this list as there are in the subroutine call, and the data types of the parameters must match.

Examples:
 SUBROUTINE GET_NEXT_VALUE
 SUBROUTINE CREATE_FULL_NAME [subchr_1, subchr_2, subchr_3]
 	 SET full_name = subchr_3 + subchr_1 + subchr_2
 	 RETURN
 END SUBROUTINE

See also:

Flow Control Commands


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