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.

Prerequisites and Context

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

Parameter Description Format Allowed Values Default Value
VARA|Process Handle Defines the name or process handle of the VARA object to generate the variables from. Script literal or script variable n.a. n.a.
APPEND_POUND_SIGN (Optional) Appends a # character at the end of the script variable names. Script literal n.a. n.a.
UPDATE|IGNORE|ABORT

(Optional) Specifies the action to take if the script variable already exists.

Script literal
  • UPDATE
    Existing script variables are updated.
  • IGNORE
    Existing script variables are ignored.
  • ABORT
    Script aborts with a script error.
UPDATE

Return Codes

The GENERATE_SCRIPT_VARS function returns the number of updated or ignored script variables.

Examples

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