Var := expression (original) (raw)

Var := expression [v1.0.25+]


Evaluates an expression and stores the result in a variable.

Parameters

Var The name of the variable in which to store the result of expression.
Expression See Expressions and the examples below for details.

Remarks

In v1.0.25.07+, the words true and false are built-in constants containing 1 and 0. They can be used to make a script more readable as in these examples:
CaseSensitive := false
ContinueSearch := true

It is possible to create an array with this command and any others that accept an OutputVar. This is done by making OuputVar contain a reference to another variable, e.g. Array%i% := Var/100 + 5. See Arrays for more information.

Related

Expressions, IF (expression), Functions, SetEnv, EnvSet, EnvAdd, EnvSub, EnvMult, EnvDiv, If, Arrays

Examples

Var := 3 Var := "literal string" Var := Price * (1 - Discount/100)

Finished := not Done or A_Index > 100 if not Finished { FileAppend, %NewText%`n, %TargetFile% return } else ExitApp