GENERATE/PREV.gifGENERATE/NEXT.gif

Factors

Factors represent the second group of operands, the first being accessors. The following factors are literals, as described in the Language Tokens topic:

<number>

<string>

<name>

<array_literal>

<point3_literal>

<time_literal>

<name_literal>

<path_name>

The bold factors below are reserved system global variables that contain distinguished values, as described in more detail in the Reserved MAXScript System Globals topic:

true

false

on

off

undefined

unsupplied

pi

e

x_axis

y_axis

z_axis

The unary minus applies the math negate operator to its operand:

-<operand>      -- unary minus

A single expression in parentheses nests the expression, forcing it to be evaluated first:

( <expr> )      -- nested expression

Because the item in parentheses can be any <expr>, you can turn any construct in MAXScript into an operand by putting it in parentheses. This allows you to write the following example, in which the operand to be indexed is the conditional result of an if expression:

(if a > b then c else d)[n + 1]

The block expression, <block_expr>, is described in more detail in the Block Expressions topic. As with a single nested expression, a block expression can be used as a simple operand anywhere in MAXScript code, allowing you to nest long sequences of code:

<block_expr>

The '?' question mark is a special variable that is used only in the context of the MAXScript Listener:

?

It names a variable that contains the result of the last expression evaluated in the Listener. For more details, see the Using the '?' Symbol topic.