Automation Engine Script Guide > Ordered by Function > Strings > ARRAY_2_STRING

ARRAY_2_STRING

Script Function: Converts a scriptA particular Automation Engine object type. array to a string.

Syntax

ARRAY_2_STRING(Script Array, [Separator], [Area])

Syntax

Description/Format

Script Array

The variableIt stores or retrieves values dynamically at runtime. An individual Automation Engine object type. name of the array.
Format: script variable

Separator One or several characters that should be included in the string between the array elements.
Format: script variableA placeholder for a value within a script. or script literal
Area

The area of the array.

Allowed values: "ALL" or "FILLED" (default)

"ALL" = All the array's elements are used.
"FILLED" = All filled elements are stored.

Return Codes

The string that includes the element of the array.

Comments

This script functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… supplies the elements of a script array as a string. The variable name of the array must be specified with the empty index brackets [].

You can also determine one or several separators that separate the elements from each other in the resulting string.

You can also determine whether all elements or only all filled elements should be used. If only the filled elements should be used, the empty elements at the end of the array are ignored.

Examples

The following example script creates an array and fills it with the entries of a Variable objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task. Subsequently, the array is converted to a string and output in the activation reportA report provides more detailed information about a task's execution or a component.. 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:

Script Elements Description
:CLEAR Resets a script array to its initial values

:DEFINE

Declares a script variable with a particular data type.

 


Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support

Copyright © 2016 Automic Software GmbH