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

  • ARRAY_2_STRING

    Converts a script array to a string

  • Script Array

    Variable name of the array which must be specified with the empty index brackets [].

    Format: script variable

  • Separator

    (Optional) 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.

    Format: script variable or script literal

  • Area

    (Optional) Arrea of the array

    Allowed values:

    • FILLED (default)

      All filled elements are stored. In this case, the empty elements at the end of the array are ignored.
    • ALL

      All the elements of the array are used

Return code

The script function returns the string that includes the element 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: