GENERATE_SCRIPT_VARS

Use the GENERATE_SCRIPT_VARS script function to generate script variables from a VARA object, or from a data sequence on the fly. This script function lets you write scripts without having to individually define each script variable. If the script variable already exists, the value is updated.

Note: The system settings must be configured to permit use of the GENERATE_SCRIPT_VARS script function. The GENERATE_UNDEFINED_SCRIPT_VARS option in the UC_SYSTEM_SETTINGS - Systemwide Settings must be set to Y.

Syntax

GENERATE_SCRIPT_VARS (Vara|Process Handle ,[APPEND_POUND_SIGN] [, UPDATE|IGNORE|ABORT])

Parameters

  • GENERATE_SCRIPT_VARS
    Generates scripts variables from a VARA object or data sequence

  • VARA|Process Handle
    Name or process handle of the VARA object to generate the variables from
    Format: script literal or script variable

  • APPEND_POUND_SIGN
    (Optional) Appends a # character at the end of the script variable names

  • UPDATE|IGNORE|ABORT
    Action to take if the script variable already exists:

    • UPDATE
      Existing script variables are updated (default)
    • IGNORE
      Existing script variables are ignored
    • ABORT
      Script aborts with a script error

Return code

Number of updated or ignored script variables

Example

A VARA object that is called VARA.STORE contains the following values:

  • Key: STORE_ADR
    Value: Sample Street 1
  • Key: STORE_LOC
    Value: Vienna
  • Key: STORE_ZIP
    Value: 1120

The following script generates script variables from the values in VARA.STORE. The script function appends a # character to the name of each script variable. The script prints the values in the activation report.

:SET &ret# = GENERATE_SCRIPT_VARS("VARA.STORE", APPEND_POUND_SIGN, UPDATE)
:PRINT The address for the store is &STORE_ADR# - &STORE_ZIP# &STORE_LOC#.

The following text is printed in the activation report:

The address for the store is Sample Street 1 - 1120 Vienna.

See also:

seealso

:DEFINE

seealso1

RESOLVE_VAR