$SETARRAY (set value to array)
$SETARRAY adds information to an array.
Syntax
$SETARRAY(array-name,character-string)
Values
-
array-name
Specifies the name of the array into which a value is to be added.
-
character-string
Specifies the value to be added to the array variable, either as a constant or a variable. A constant must be enclosed in single quotation marks ('').
Status
The following table lists and describes the possible statuses:
Status |
Description |
---|---|
NORMAL |
Normal end |
NODATA |
— |
ERROR |
— |
Script execution interrupted |
An invalid argument was specified, or an error other than the above occurred. |
Example
The following example initializes the array ARY and sets to it array data ARY[1] aaa, ARY[2] bbb, and ARY[3] ccc. In this example, the value in array number 2 of the created array variable is then updated to ddd, which is then acquired and output.
[SET_VALUE] $CLEARARRAY(ARY) $SETARRAY(ARY,'aaa') $SETARRAY(ARY,'bbb') $SETARRAY(ARY,'ccc') $UPDARRAY(ARY,2,'ddd') VAL = $GETARRAY(ARY, 2) MSG = 'ARY = ' + VAL $ECHO(MSG)
- Execution result:
-
ARY = ddd