Operators

Operators behave like predefined functions that are part of the the Delphi 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, A, *, /, div, mod, and, shl, shr, as, +, -, or, xor, =, >, <, <>, <=, >=, in, and is.

The operators @, not, and a are unary (taking one operand). All other operators are binary (taking two operands), except that + and - can function as either a unary or binary operator. A unary operator always precedes its operand (for example, -b), except for a, which follows its operand (for example, pa). 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.

Except for a, is, and in, all operators can take operands of type Variant.

The sections that follow assume some familiarity with Delphi data types.

For information about operator precedence in complex expressions, see Operator Precedence Rules, later in this topic.

Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook


Post a comment