Search code examples
operatorsundefinedautohotkeyvariable-assignmentassignment-operator

If a variable is not assigned any value, what would its value be in AutoHotkey?


Consider the following code, what's the value of Foo?

Foo :=

Solution

    • The colon-equals (:=) is an expression assignment operator. It assigns a value to a variable (stores the result of an expression in a variable).

    • Without a value assignment Foo := makes no sense.

    • You can assign an empty value ( or empty the content of the variable Foo) by setting it to "":

      Foo := ""