$GETARRAYBYKEY (get value from array with key)
$GETARRAYBYKEY acquires information corresponding to a specified key from keyed information stored in an array.
Syntax
return-value=$GETARRAYBYKEY(array-name,key-value(,array-number-in-key))
Values
-
return-value
Specifies the name of the variable into which the acquired value is set.
-
array-name
Specifies the name of the array from which to read information.
-
key-value
Specifies the key to the information to be acquired. If no array element exists in the specified key, a 0-byte character string is returned.
-
array-number-in-key
Specifies the array number in the key when there are multiple data values that correspond to the specified key, either as a constant or a variable. A constant must be enclosed in single quotation marks (''). Specified values can range from 1 to 2,147,483,647.
If no array element of the array number specified in the key exists, a 0-byte character string is returned.
Status
The following table lists and describes the possible statuses:
Status |
Description |
---|---|
NORMAL |
Normal end |
NODATA |
Indicates one of the following:
|
ERROR |
— |
Script execution interrupted |
An invalid argument was specified, or an error other than the above occurred. |
Example
See the example in $SETARRAYBYKEY (set value to array with key).