Scripts consist of a series of statements. They start by executing the first statement in the script and then proceed to the last. Statements provide the building blocks that allow programs to be created (for example, assignment, branching, or looping). Multiple statements can be placed on a single line by separating with the colon (:) character. A statement must be contained in one line (except specific multi-line statements such as IF...THEN...ELSE, documented below).
Statement |
Description |
|---|---|
Returns reference to a subroutine or function. Used to assign event handlers to events. |
|
Assigns the value of an expression to a variable or a (writeable) object property. |
|
Call a subroutine or function. |
|
Declare a constant value. |
|
Declares variables and allocates storage space. |
|
Repeats a block of statements while a condition is True or until a condition becomes True. |
|
Used to release array variables and de-allocate the memory used for their elements. |
|
Raises a program exception of User Error and terminates the active process. This is commonly used in scripting to terminate a script on an error condition. |
|
Repeats a group of statements a specified number of times. |
|
Declares the name, arguments, and code that define a Function procedure. |
|
A compound multi-line statement designed to allow conditional execution of other statements. There is also an abbreviated single line version. |
|
Imports another script source file into the current script file. |
|
Allows control over how comparisons are performed. |
|
Allows control over what happens after every print statement and how strings are delimited. |
|
Controls how forms created using CreateObject forms are opened. |
|
Outputs the value of an expression to the output stream. |
|
Replaces the last line in the output stream with the value of an expression. |
|
Declares global variables and allocates storage space. |
|
Used to size or resize a dynamic array formally declared using a Dim statement. |
|
Used for adding comments (or remarks) that are not executed by MaxBasic. |
|
Returns control to the code that called a Sub or Function procedure. |
|
Executes one of several groups of statements, depending on the value of an expression. |
|
Declares the name, arguments, and code that define a Sub procedure. |
|
Use to re-throw caught exceptions, the re-throws retain the original message and source path. |
|
A compound multi-line statement designed to allow exception handling for block of statements. |