quietjas.blogg.se

Ahk v2
Ahk v2







ahk v2

For example: MsgBox The value in the variable named Var is %Var%.īy contrast, the expression method omits the percent signs around variable names, but encloses literal strings in quotes. The legacy method requires that each variable name be enclosed in percent signs to retrieve its contents. Retrieving the contents of variables: Like the two methods of storing values, there are also two methods for retrieving them: legacy and expression.

ahk v2

The empty pair of quotes above should be used only with the := operator because if it were used with the = operator, it would store two literal quote-characters inside the variable. You may have guessed from the above that there are two methods to erase the contents of a variable (that is, to make it blank): MyVar = The latter method is preferred by many due to its greater clarity, and because it supports an expression syntax nearly identical to that in many other languages. The following examples are functionally identical to the previous ones: MyNumber := 123ĬopyOfVar := Var Unlike its counterpart in the previous section, percent signs are not used with the := operator. For example: MyNumber = 123ĬopyOfVar = %Var% With the = operator, percent signs are required to retrieve a variable's contents.īy contrast, the expression method uses the colon-equal operator (:=) to store numbers, quoted strings, and other types of expressions. The legacy method uses the equal sign operator (=) to assign unquoted literal strings or variables enclosed in percent signs. Storing values in variables: To store a string or number in a variable, there are two methods: legacy and expression. See Variables for general explanation and details about how variables work. Variables and Expressions - Definition & Usage | AutoHotkey Variables and Expressions Table of Contents









Ahk v2