OpenSTA logo OpenSTA SCL Reference
Variable Arrays

Variable Arrays

Character and integer variables declared within the DEFINITIONS section of a Script may be defined as arrays. SCL supports arrays of up to three dimensions. There is no defined limit to the number of elements which may be declared in an array dimension.

If an array of two or three dimensions is specified, each dimension must be separated from the following dimension by a comma. When an array is referenced, array subscripts must be specified for each of its dimensions.

The numbering of the array elements is dependent on how the array was declared. SCL supports both start and end array subscript values within the array declaration itself.

For example both of the variable declarations below declare an array of character variables each with 12 elements. The elements in the array are both numbered 1 to 12.

CHARACTER*9 Months[1:12]
CHARACTER*9 Months[12]

Compare these with the following example which also declares an array of 12 elements, but the array elements are numbered from 0 to 11.

CHARACTER*9 Months[0:11]

Only positive values can be specified for the start and end array subscript values, and the start value must be less than or equal to the end value. If the start value is omitted, it defaults to 1.

When you want to retrieve a value from an array variable, you can use numeric literals, integer variables, or complex arithmetic expressions to specify the element(s). For example:

SET Tax = Revenue[Office, Index+1] * 0.175

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