ARRAY_2_STRING
Use the ARRAY_2_STRING script function to convert a script array to a string that includes the elements of the array.
Syntax
ARRAY_2_STRING (Script Array, [Separator,] [Area])
Parameters
| Parameter | Description | Format | Allowed Values | Default Value |
|---|---|---|---|---|
| Script Array | Defines the variable name of the array which must be specified with the empty index brackets []. | Script variable | n.a. | n.a. |
| Separator | One or several characters that should be included in the string between the array elements. They separate the elements from each other in the resulting string. | Script literal or script variable | n.a. | n.a. |
| Area | Specifies the area of the array to use. | Script literal |
|
FILLED |
Return Codes
The ARRAY_2_STRING function returns the string that includes the elements of the array.
Examples
The following example script creates an array and fills it with the entries of a VARA object. Then, the array is converted to a string and printed in the activation report. A hyphen is used as a separator for the array elements.
: DEFINE &ARRAY#, string, 5
: DEFINE &STR#, string
: FILL &ARRAY#[] = GET_VAR(VARA.STATIC.TEST,"KEY01")
: SET &STR# = ARRAY_2_STRING(&ARRAY#[],"-",FILLED)
: P"&STR#"
See also:
seealso