Script Statement: Assigns a value to a script variable and stores it in the activation report.
:RSET Script variable = [Value]
Syntax |
Description/Format |
---|---|
Script variable |
The name of the script variable to which a value should be assigned. A script variable's name for the :PSET and :RSET script statements is limited to 31 alphanumeric characters (in most other cases script variable names are limited to 32 characters), including the special characters "$", "_", "@", "ยง" and "#". German Umlauts are not allowed. The first character must not be a number. Variables within the script must always specified with a leading "&" following the variable name! Format: script variable |
Value |
The value that should be assigned. |
This script statement stores the value that it assigns to a script variable in the activation report. The following line is written to the activation report:
YYYY-MM-DD HH:MM:SS - U0020206 Variable '&VAR#' was stored with the value 'VALUE'.
You can use the script elements :RSET and :READ to store values of script variables in the report.
The stored value can then be used in various ways.
You ca restart tasks with this stored value. No value assignment (which is part of the script statement) takes place if you restart a task. Activation is canceled when the relevant script variable cannot be found. The value that has last been assigned is used when the script variable has been stored several times and no warning message is displayed.
A different way of using this script statement is to pass the content of a job's script variable from Process to Post Process. In the Process tab, the value is assigned to the script variable. In the Post Process tab, the script statement is called again. No value is assigned this time but the script variable then contains the script value which has last been stored in the activation report.
Note that the data types "signed" and "float" will automatically be converted to "string" when the value of a script variable is stored to the activity report using the script element :RSET. Data type "unsigned" will not be converted.
Using :RSET in the script of a workflow generates an object variable that will also be passed on to subordinate workflow tasks (provided that this option is activated in the child tasks). An overlap of the object variable's name with the name of the workflow task can cause an error when the subordinate workflow tasks are generated (see : script variable- syntax). Make sure that variable names always end with a special character in order to avoid overlaps.
When you assign :SET and :RSET statements the same script variable with different values, their values will be set by those :SET and :RSET statements when the job is executed. However, if the job is restarted, the values of both variables will be set by the :SET statement. This is because :RSET statements automatically create object values and :SET statements automatically save the value for a restart. This is a change in behavior from v8, where :RSET statements did not create object values.
The following example accesses a script variable whose value is already set in the Process tab in the Post Process tab.
Process tab:
:RSET &TEXT# = "test"
:SET &NUMBER# = 1
:RSET &NUMBER# = ADD(&NUMBER#,1)
Post Process tab:
:RSET &TEXT#
:RSET &NUMBER#
:PRINT &TEXT#
:PRINT &NUMBER#
The values "test" and "2" are transferred to the Post Process tab and written to the activation report.
See also:
Script element | Description |
---|---|
Assigns a value to an object variable. |
|
This assigns a value to a script variable. |
|
:SET_SCRIPT_VAR | Sets the values of script variables by indirect access. |
Script Elements - Script Structure and Processing
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by function