MAXScript Language Reference > Variables - Assignment and Scope >

# Changes to Undeclared Implicit Global Variables

## Changes to Undeclared Implicit Global Variables since 3ds Max 4

In releases prior to 3ds Max 4, 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 MAXScript documentation.

It was also preventing the new stack-based MAXScript 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

- Scope of Variables