Assign (=)

Syntax

Command Description Return Value
<variable> = <value> Sets the value of the variable The value the variable was set to
  • <variable>
    • A user variable or system variable name. Must be enclosed in double quotes.
  • <value>
    • A string (a combination of characters enclosed in quotes, such as “Hello World”).
    • A number (a whole number, or a decimal number, such as 123 or 12.7).

Alternate Syntax

See: Set command.

Description

Setting Values

The Assign command sets the value of a variable. The variable can be user defined (such as xyz, LoopCount, or IsMyShowEnabled), or it may be a system variable (such as button.onColor or lcd.backlight. System variables always contain a “dot” character ( . ). User variables must not contain a “dot” character, otherwise, they will be interpreted as a system variable, and they will not be stored properly.

User variables can be defined on the fly, simply by assigning a value to a variable. There is no need to pre-define variables.

See the Assign command for an alternate syntax for assigning variable values.

See the Variables section for how to use variables in the script language.

See the System Variables section for a complete list of available system variables.

Examples

"x"=3
Sets the variable x to the number 3.

"text"="Hello World"
Sets the variable text to the string Hello World.

"lcd.backlight"=25
Sets the system variable lcd.backlight to 25%.

"y"=('x' + 1)
Sets the variable y to the result of the expression 'x' + 1.

See Also