Basic syntax rules

Spelling

Maxscript is not case sensitive.

x and X would be considered the same.

MaxScript Statements

MaxScript statements terminate at the end of line. If the expression at the end of the line is not a complete expression it will attempt to continue reading till the end of the next line.

These two statements are the same

3 * 2 + 3
3 * 2 +
3

Try typing above into listener to see what happens.

Explicit statement continuation

You can also explicitly continue a line use backslash \

For example (this is same as above):

3*2 \
+3

Multiple statements on the same line

If you want to have mulitple expressions on the same line, you can separate them with semi-colons ;

3*2+3;4+4

Comments

comments in maxscript start at double hyphens and lasts till end of line:

3+2 --this part is a comment after the 3+2 expression

C style comments using/* and */ are also supported

datatypes

maxscript variables do not have explictly declared types. The way to think about them is that they are like generic references. When you say:

a = 5

you are make a refer to an integer value so a will behave like an integer.

If later you do the following:

a = 5.0

then a will start behaving like a floating point value (think of it as throwing away the reference to the original integer and refering to a new floating point value instead)