What is New in MAXScript > What was New in MAXScript in Previous Versions > What was New in MAXScript in 3ds Max 6 >

# MAXScript Language Improvements in 3ds Max 6

## Garbage Collector Improvements

Manual Garbage Collection

This change to MAXScript extends the light:true parameter behavior introduced in 3ds Max 5 to automatic garbage collection.

## Structure Scope Set When Initializing

Structure Scope While Initializing

When initializing a structure, the scope will now be set to the structure's context. Note that this effectively lets you run a function within the structure when an instance of the structure is created!

## Return Values and Exiting Loops

You can now call return() in macroScripts whose body is a single expression (i.e, old style macroScripts that don't use 'on execute do ...') to exit the macroScript.

For Loop

A new optional while <expr> test has been added to the for loop. The for loop will terminate if the test expression evaluates to false .

Loop Exit

Exiting a for ... do loop using a with <expr> returns the expression value as the result of the loop. In releases prior 3ds Max 6, OK was returned.

## ArrayParameter values coerced to Array.

ArrayParameter Values

ArrayParameter values can now be coerced to Array.

FOR EXAMPLE:
    mtl = standard()
    mapsArray = mtl.maps as array

## modPanel.ValidModifier Improvements

Modify Panel

The modPanel.validModifier method has been changed to return false if either the node/node collection or modifier/modifier class is 'undefined', or the node collection is empty.

## Hide, Unhide, Freeze and Unfreeze Performance Improvements

Node Common Methods - Viewport State

The way the mappable methods hide, unhide, freeze and unfreeze are called when passed a node collection has been changed so that there is a single internal call passing a node array, rather than individual calls passing one node at a time.

The speed of these methods will be significantly higher than in older versions.

## ActiveX

Setting Focus on User Interface Controls

The setFocus <rollout_ui_item> function can now be used with ActiveXControl UI items.

#### See Also

- What was New in MAXScript in 3ds Max 6
- Documentation Changes in 3ds Max 6
- MAXScript Documentation Changes in 3ds Max 5.1.1 (Particle Flow Update)
- New Classes In 3ds Max 6