Overview of expressions and operators
An operand is a language element that represents a value, and an operator is a language element that determines how the value of an expression is to be computed from its operand or operands. A unary operator performs an operation on a single operand, and a binary operator performs an operation on two operands. An expressionis a sequence of operators and operands that evaluates to a single value at run time.
An expression can consist of any of the following:
- A literal value -- for example, the integer 5 or the string "my cat Geoffrey"
- A constant, variable, property, or function representing a single value -- for example, anInteger%, aString$, checkBox1.State, CStr(anInt%)
- One or another of the preceding plus a unary operator -- for example, - anInt%
- Two of the preceding separated by a binary operator -- for example, anInt% * anotherInt%
- Two other expressions separated by a binary operator -- for example, (anInt% > 0) And (anInt% <= 10)
All legal expressions evaluate to a numeric value, a String value (possibly the empty string), NULL, EMPTY, NOTHING, or the Boolean value True (-1) or False (0).