This snippet shows you local and global variables in use - NOTE, it's not meant to be run
global x as integer
y as integer
x = 1 : ` x is global
y = 1 : ` y is local outside of the functions
z = 1 : ` z is local outside of the functions
a = 1 : ` a is local outside of the functions, because not declared
function abc()
y as integer
local z as integer
a = 1 : ` a is local because it has not been declared global
x = 1 : ` x is global
y = 1 : ` y is local to this function
z = 1 : ` z is local to this function
endfunction
Make sure that you name your variables very carefully. Using the code above, the logig would change drastically if you suddenly made the variable 'a' a global. That's why I get into the habit of doing the extra typing and declaring all my local variables