Variables

Assigns a value to a Variable using the chosen operator. You can also assign expressions and linear/associative arrays using the "Expression" option. For more information see Variables & Arrays/Objects.

Variables (Shift+F10)

Parameters

Output Variable
Name of the Variable in which to store the contents. This field accepts Object references such as Array[1] or Obj.Name.
Operator
Operator to use in the assignment.
Value

If Expression is not checked, this field accepts strings, numbers and variables enclosed in percent signs. When using Expression, you can enter any valid expression.

X := A string value ; If "Expression" is not checked, you don't need to use quotes for strings.
X := Today is %A_DD%. ; And it's necessary to enclose variables in percent signs.
Expression

If checked, the value will be considered an expression. You can enter any valid expression, which may contain strings enclosed in quotes, variables (not enclosed in percent signs), numbers, math operations, functions and object references, including creating arrays.

X := FoundX + 100 ; Assigns X to the value of FoundX + 100.
X := InStr("AutoHotkey", "y") + 4 ; Assigns X to 14.
X := [10, 20, 30, "String", Variable] ; Creates an array.
X := Array(1, 2, 3) ; Creates an array with the Array function.
Y := X[1] ; Assigns Y to the first value in the X array.
Y += 1 ; Increments Y by 1.
X := {Name: "John", Age: 25}) ; Creates an associative array.
X[Name] := "George" ; Sets the "Name" element of X to "George".
X.Age += 2 ; Adds 2 to the "Age" element of X.

Note: To keep this option enabled by default go to Settings > General and check the option.

Copy
Copies the variable's contents to the Clipboard.
Reset
Erases the variable's contents.

Variables