Next: , Previous: VARIABLE LEVEL, Up: Variable Attributes



8.17 VECTOR

     Two possible syntaxes:
             VECTOR vec_name=var_list.
             VECTOR vec_name_list(count).

VECTOR allows a group of variables to be accessed as if they were consecutive members of an array with a vector(index) notation.

To make a vector out of a set of existing variables, specify a name for the vector followed by an equals sign (=) and the variables that belong in the vector.

To make a vector and create variables at the same time, specify one or more vector names followed by a count in parentheses. This will cause variables named vec1 through veccount to be created as numeric variables with print and write format F8.2. Variable names including numeric suffixes may not exceed 64 characters in length, and none of the variables may exist prior to VECTOR.

All the variables in a vector must be the same type.

Vectors created with VECTOR disappear after any procedure or procedure-like command is executed. The variables contained in the vectors remain, unless they are scratch variables (see Scratch Variables).

Variables within a vector may be referenced in expressions using vector(index) syntax.