Previous Topic

Next Topic

Book Contents

Book Index

MaxBasic Operators

An operator manipulates one or two expressions to yield a new value as part of a larger expression. Operators are defined in certain ways for certain types, and the result is always of a certain type (or undefined in cases that cause exceptions, such as divide by zero). Compound expressions are built from simpler expressions by combining with operators.

MB Operator Precedence

The order that operators are applied in expressions can be controlled with the use of parentheses (). Sub-expressions inside parentheses are evaluated first. Where an expression or sub-expression contains more than one operator, operator precedence determines the order of expression evaluation. Where operators have equal precedence, expressions are evaluated left to right. The following table lists the operators in decreasing order of precedence:

Operator

^

Unary -

*, /

\

Mod

+, -

&

=, <, >, <=, >=, <>

Not

And

Or

Xor

Eqv

Imp

In This Section

MaxBasic Arithmetic Operators

MaxBasic Comparison Operators

MaxBasic Boolean Operators

MaxBasic String Operators

MaxBasic Date Operators