Topic: version 4 MAXScript Language Improvements/Globals and Locals
In prior releases, the MAXScript compiler was treating any undeclared variables used in rollout and plug-in and macroScript handlers as implicitly global. This was at variance with the use of undeclared variables inside ordinary functions and for-loop bodies and also at variance with the main scripter documentation. It was also preventing the new stack-based scripter memory management system from achieving maximum effect in handler execution.
All undeclared variables in handler code are now implicitly declared as locals.
See also
Definition Constructs Can Include Global Variable Declarations At Top Level