:PUT_VAR_PROCESS
Script Statement: Writes the content of a data sequence to a static VARA object.
Syntax
:PUT_VAR_PROCESS VARA object, Data Sequence Reference
Syntax |
Description/Format |
---|---|
VARA object |
The name of the static VARA object in which the values should be stored
. |
Data Sequence Reference |
The reference of the data sequence whose content should be written to the VARA object.
|
You can use this script element in order to fill a static VARA object with the content of a data sequence. The columns of the data sequence are written to the columns of the VARA object (including the Key column).
Keep the following in mind:
- The script element :PUT_VAR_PROCESS removes all entries of the VARA object before it re-fills it. The result is that the VARA object will include the exact entries of the data sequence once you have successfully run this script element.
- Static VARA objects include 6 columns (the Key column plus five value columns). The script element :PUT_VAR_PROCESS fills these columns with the first 6 columns of the data sequence. This means that when the data sequence includes more than 6 columns, these will be ignored.
- When :PUT_VAR_PROCESS tries to write in variable values which are not accepted because they duplicate a key or there is only one accepted entry, it returns the error number 20683 via sys_last_err_nr() and the location of error via sys_last_err_ins().
Warning! You cannot specify dynamic VARA objects because they retrieve their values dynamically and do not store them statically.
Example
The following example writes 1000 lines with PUT_VAR_PROCESS:
:SET&HND# = PREP_PROCESS_VAR("VARA.PUT_VAR_PROCESS")
:SET &CNT# = 0
:WHILE &CNT# < 1000
: SET &CNT# = &CNT# + 1
: SET &KEY# = "KEY&CNT#"
: SET &COL1# = "COL1-&CNT#"
: SET &COL2# = "COL2-&CNT#"
: SET &COL3# = "COL3-&CNT#"
: SET &COL4# = "COL4-&CNT#"
: SET &COL5# = "COL5-&CNT#"
: SET &LINE# = "&KEY#§§§&COL1#§§§&COL2#§§§&COL3#§§§&COL4#§§§5"
: SET &RET# = PUT_PROCESS_LINE(&HND#, "&LINE#")
:ENDWHILE
:PUT_VAR_PROCESS"VARA.PUT_VAR_PROCESS",&HND#
:CLOSE_PROCESS&HND#
See also: