GET_SCRIPT_VAR

Use the GET_SCRIPT_VAR script function to query the values of different script variables without writing multiple conditional statements. This function uses a placeholder to return the values of script variables indirectly. You do not need to set the names of the script variables directly in your script as the placeholder acts as a variable. The function lets you query the values of multiple variables with a single script line, and is useful in processing loops. The placeholder that you define is a string that contains the name of one or more variables whose values you want to return

The script function retrieves values from the following types of objects:

Syntax

GET_SCRIPT_VAR (Script variable)

Parameters

Important!

Example

This example uses a script in a Job to retrieve names and values from a VARA object that is called SCRIPT_VARA. The script prints the retrieved names in the activation report. Assume that the VARA object contains the following script variable names:

Write the following script in the Job:

:SET &END#    = "20051027"
:
SET &START#  = "20051024"
:
SET &ULTIMO# = "20051031"  

:
SET &HANDLE# = PREP_PROCESS_VAR("SCRIPT_VARA")    

:
PROCESS &HANDLE#
:   
SET &VARIABLE# = GET_PROCESS_LINE(&HANDLE#,1)
:   
SET &VALUE# = GET_SCRIPT_VAR(&VARIABLE#)
:   
PRINT  "&VARIABLE# = &VALUE#"
:
ENDPROCESS

:
CLOSE_PROCESS &HANDLE#

Where:

The script reads the script variable names from the VARA object. The variable name is passed to a script variable called &VALUE#. A :PRINT statement uses the variable &VALUE# to write the values for END#, &START# and &ULTIMO# to the activation report.

The following lines are written to the activation report:

2005-02-03 12:51:23 - U0020408 End = 20051027
2005-02-03 12:51:23 - U0020408 Start = 20051024
2005-02-03 12:51:23 - U0020408 Ultimo = 20051031

See also:

seealso1

RESOLVE_VAR