jonny
Joined: 13 Nov 2004 Posts: 3004 Location: Minnesota
|
Posted: Fri Apr 22, 2005 9:22 pm Post subject: |
|
|
Yes, the concept of local variables is very new to AutoHotkey. In any regular label (hotkey and hotstring definitions count), all variables are global. Only in functions is there a distinction between global and local variables. As an example, this function will not make its variable global by default:
| Code: | assign()
msgbox,%variable%
return
assign()
{
variable = Lorem Ipsum
return
} |
However, this label will:
| Code: | gosub,assign
msgbox,%variable%
return
assign:
variable = Lorem Ipsum
return |
You can learn more about this behavior by reading the Functions section in your help file. |
|