Variable - Set Value

Sets the value of a variable to a specified value or the result of an expression.

Action ID:
Action Category:
Action List Syntax:

6
Variable
<<VARIABLE>>
= Variable.SetValue (<<VALUE>>)

Settings

Variable name:

The name of the variable to store the result in. If the variable does not already exist, it will be created automatically.

If you provide the name of an existing variable, the result will overwrite that variable's contents. If you provide a new variable name, a new variable will be created automatically. The action's result will be stored in the variable you provide, regardless of whether the variable already exists. In other words, you can create a new variable "on the fly" by simply providing a variable name that isn't already being used in your project.

Value:

The value to assign to the variable.

Evaluate value as expression

Whether the contents of the Value field should be evaluated as an expression at run time.

If enabled, the text in the Value field will be interpreted as an expression at run time, and the result of this expression will be stored in the variable.

If disabled, the text in the Value field will be stored in the variable as-is.

Build...

Opens the Build Expression dialog which provides a useful interface to help you build the expression.

This button is only visible if the Evaluate value as expression option is enabled.

Error Codes

Value
(%LastErrorNum%)

Simple Message
(%LastErrorMsg%)

Verbose Message
(%LastErrorDetails%)

0 (OK)

 

 

1

MSG_ERR_EVALUATE_EXPRESSION

MSG_ERR_EVALUATE_EXPRESSION
MSG_ERR_MISSING_VALUE
<<VALUE>>

2

MSG_ERR_EVALUATE_EXPRESSION

MSG_ERR_EVALUATE_EXPRESSION
MSG_ERR_MISSING_OPERATOR
<<VALUE>>

Examples

Adding an item to a delimited string

Expiring 30 days after running the first time

Moving a window (advanced)

Parsing paths

Running a PowerPoint presentation

Searching the desktop for text files

Storing information in the Registry

Verifying a password (advanced)