sarr
Purpose:
Set array variable elements to a specified value based on provided label and dimensions.
Enter:
- sarr <array_label> <value>
Where:
-
array_label Specify the array variable label name. This may include dimension specifications using ‘:’ for enums or ‘?’ for variables.
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.value Specify the value to assign 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: