Script statement: Stores several values to a scriptA particular Automation Engine object type. array.
:FILL script array =values
Syntax |
Description/Format |
---|---|
Script array |
Name of the script variableA placeholder for a value within a script. that has been defined as an array. Use the square brackets without content. |
Values |
Values that should be stored to the array. You can use the script functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… GET_PROCESS_LINE or GET_VAR for this purpose. |
This script function can be used to store several values to a script array at a time. Arrays must be created using :DEFINE. An array size must be specified because otherwise you cannot assign values. You can use the script function GET_PROCESS_LINE, STR_SPLIT or GET_VAR for this purpose. The values are written to the array starting with the first element (index = 1).
If the number of values that should be stored exceeds the array's capacity, only the first values are stored until the capacity is used to its full. If the array is larger than the retrieved values, all other values remain unchanged.
Use empty square brackets [] in order to indicate the script array in this function.
In order to pass arrays between subordinate or superordinate objects :PUBLISH must be used.
The first example uses GET_VAR in order to store the values of a Variable objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task to the array.
:DEFINE &ARRAY#, string, 20
:FILL &ARRAY#[] = GET_VAR(VARA.TEST, KEY1)
:PRINT "First value of the variableIt stores or retrieves values dynamically at runtime. An individual Automation Engine object type. VARA.TEST, key KEY1: &ARRAY#[1]"
The second example creates the columns of a log file's first line (Automation EngineThis component drives an Automation Engine system and consists of different types of server processes.) in the array.
:DEFINE &ARRAY#, string, 20
:SET &HND# = PREP_PROCESS_FILE(WIN01, "C:\AUTOMIC\AUTOMATIONENGINE\TEMP\CPsrv_log_001_00.txt","*","COL=LENGTH""LENGTH_TAB,,,='8=DATE,1,6=TIME,7,200=TEXT'")
:PROCESS &HND#
:FILL &ARRAY#[] = GET_PROCESS_LINE(&HND#)
:ENDPROCESS
:SET &RUNVAR# = 1
:SET &LEN# = LENGTH(&ARRAY#[])
:WHILE &RUNVAR# LE &LEN#
:P "Line &RUNVAR#: &ARRAY#[&RUNVAR#]"
:SET &RUNVAR# = &RUNVAR# + 1
:ENDWHILE
See also:
Script Element | Description |
---|---|
:PUBLISH | Defines script variables and arrays as object variablesPlaceholder for values that are stored in an object's "Variables & Prompts" tab/section.. |
Retrieves the current line content of a data sequenceAn internal listing of Console outputs or lines of Variable objects, etc. The lines of a data sequence can be accessed by using a PROCESS loop or the script element GET_PROCESS_LINE. The script elements PREP_PROCESS* generate data sequences.. |
|
GET_VAR | Returns the content of a Variable object. |
FIND | Searches through a script array and returns the corresponding index. |
LENGTH | Retrieves the size of a script array. |
Script Elements - Data Sequences
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by Function
Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support |
Copyright © 2016 Automic Software GmbH |