sarr

Purpose:

Set array elements

Enter:

sarr <arr_vrbl> : [enum_str] ? [indx_valu]… <value>

Where:

arr_vrbl Specify the array variable name.
: Specify the : symbol to designate that the following index is either a constant integer, an enum defined in the array_specs file, or an INTEGER_VARIABLE that contains the integer value of the dimension to be used.
? Specify the ? symbol to designate that the following index is either a constant integer, an enum defined in the array_specs file, or an INTEGER_VARIABLE that contains the integer value of the dimension to be used.
enum_str Optional. Specify a string to result in all elements associated with the specified enum string to be set to ‘value’.
indx_valu Optional. Specify this option to use the value contained in the INTEGER_VARIABLE ‘indx_valu’ that will result in all elements associated with the specified enum string to be set to ‘value’.
value Specify the value that will be assigned to the specified elements of the array variable.

Example:

sarr my_arr 123
The above command sets all array elements of <my_arr> to 123.

sarr  my_vrbl:TC15 abcd
The above command sets all the elements for array variable <my_vrbl> that are associated with enum element TC15 to abcd.

sarr   my_vrbl?count  abcd
The above command seta all the elements for array variable <my_vrbl> that are associated with the dimension number contained in the variable count to abcd.

sarr my_arr my_real
The above command sets all array elements of <my_arr> to the value found in variable my_real.

sarr my_arr “my_real + 100[kpa]”
The above command sets all array elements of <my_arr> to the value of the computed expression.

sarr my_string  “ ‘this is a literal string’  “
The above command sets all array elements of the string array <my_string> to  ‘this is a literal string’

sarr my_string:0  “ ‘a go was performed on ’ + go_time  “
The above command sets <my_string:0> to the result of the computed expression.’

Notes:

When using the computed expression function ‘@set_array()’ to set an array variable, the arguments must be enclosed with a single quote.

For example:
@set_array( ‘my_vrbl:TC15’,  ‘abcd’ )

See Also:

Array Variables