:RSET
Script Statement: Assigns a value to a script variable and stores it in the activation report.
Syntax
:RSET Script variable [= Value]
Syntax |
Description/Format |
---|---|
Script variable |
The name of the script variable to which a value should be assigned. You must always use an ampersand symbol (&) that precedes the script variable's name, and it is recommended that you use a hash (#) symbol to signal the end of the variable's name The length of a script variable's name for the :PSET and :RSET is limited to 31 characters. All characters of the alphabet, the numbers 0-9, and the following special characters can be used:"$", "_", "@", "ยง" and "#". German Umlauts are not allowed. The first character after the leading "&" must neither be a number nor a "$" symbol. For more details about the syntax, see Syntax. Format: script variable |
Value |
The value that should be assigned. |
Comments
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 - U00020206 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 can 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 page, the value is assigned to the script variable. In the Post Process page, the script statement is called again. No value is assigned this time but the script variable now contains the script value that has last been stored in the activation report.
Warnings:
- 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). Object Variables store values that can be used throughout an object. They are defined on the Variables page of an executable object or with the :PSET script statement.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 happens because :RSET statements automatically create object values and :SET statements automatically save the value for a restart.
Example
The following example accesses a script variable whose value is already set in the Process page in the Post Process page:
Process page:
:RSET &TEXT# = "test"
:SET &NUMBER# = 1
:RSET &NUMBER# = ADD(&NUMBER#,1)
Post Process page:
:RSET &TEXT#
:RSET &NUMBER#
:PRINT &TEXT#
:PRINT &NUMBER#
The values "test" and "2" are transferred to the Post Process page 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