Operators

Navigation:  Les scripts > Les autres scripts >

Operators

Previous pageReturn to chapter overviewNext page

Operators behave like predefined functions that are part of the Object Pascal language. For example, the expression (X + Y) is built from the variables X and Y—called operands—with the + operator; when X and Y represent integers or reals, (X + Y) returns their sum. Operators include @, not, ^, *, /, div, mod, and, shl, shr, as, +

, –, or, xor, =, >, <, <>, <=, >=, in, and is.

 

The operators @, not, and ^ are unary (taking one operand). All other operators are binary (taking two operands), except that + and – can function as either unary or binary. A unary operator always precedes its operand (for example, -B), except for ^, which follows its operand (for example, P^). A binary operator is placed between its operands (for example, A = 7).

Some operators behave differently depending on the type of data passed to them. For example, not performs bitwise negation on an integer operand and logical negation on a Boolean operand. Such operators appear below under multiple categories.