Variables do not need be declared before using, but they do have scopes. The smallest scope
is a block between a pair of
When a variable is assigned a value, the runtime engine traces the scope stack trying to find the variable; if a variable is found, it is used; otherwise, a new variable is created in the inner-most scope. To force the variable to be local to the current scope, declare the variable as local . A local variable shields any same-name variable beyond the current scope.
A variable in the global scope is called a global variable. To explicitly access a global
variable, precede the name with the