Declares a variable local to a function.
LOCAL var1, var2, ..., varN
varN |
- |
One or more variable names. |
SPL recognizes j and fft as local variables. The symbol fft is treated as a local variable, not the FFT function.
An undeclared variable assigned in an SPL function is treated as a local variable. Thus, the local keyword is not strictly necessary, but is extremely useful for eliminating a conflict between a local variable name and a function or macro. The keyword also provides optimization benefits as the type of variable is made explicit.
The value of an undeclared variable referenced in an SPL is first searched as a local variable. If not found, the variable is treated as a global variable.
See STATIC to define local variables that are persistent across SPL function calls.
See GLOBAL or EXTERN to define global variables in an SPL function.
See NONLOCAL to define a variable that can be private to one SPL function but accessible to another.