Previous Topic: Declare ArraysNext Topic: Special Characters


Expressions

Expressions consist of operators and operands.

Operators include: AND OR * / + - = <> < > <=

The rules of precedence that apply to operators follow the rules of algebra. In other words, all operators take two operands.

Note: The NOT operator does not exist, but you can use the predefined function NOT.

If the operands are of type String, the + operator concatenates them:

DIM FirstName as String
DIM LastName as String
DIM FullName as String
DIM Space as String
FirstName="Mary"
LastName="Johnson"
Space=" "
FullName=FirstName+Space+LastName

The expression FirstName+Space+LastName evaluates to "Mary Johnson" and thus the contents of the string FullName is "Mary Johnson."

If you use the + operator with operands of type Integer, the script interpreter adds the operands:

DIM X as Integer
DIM Y as Integer
DIM Z as Integer
X=2
Y=3
Z=X+Y

The variable Z contains the integer value 5.

The result type of an expression is the largest type of operand.

Byte+Word = Word
Char+String = String