How is a "local" variable distinguished from a "global" variable?

Q

How is a "local" variable distinguished from a "global" variable?

A

Variables with preceding local are valid only until the executed block where they are defined. The use of local variable has a small speed advantage, since the interpreter accesses to local variables via indexes and not via their names in the variable table.

Local variables defined in the root of script or are no longer available in the next cycle of the script. The same when defined in functions. When the function is left, the value is gone.