IF...THEN...ELSE function
- Last Updated: February 11, 2026
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
Evaluates and returns one of two expressions, depending on the value of a specified condition.
Syntax
|
- condition
- An expression whose value is logical (TRUE or FALSE).
- expression1
- A constant, field name, variable name, or expression. If the condition is TRUE, then the function returns this value.
- expression2
- A constant, field name, variable name, or expression whose value
is of a data type that is compatible with the data type of expression1.
If the condition is FALSE or the Unknown value (
?), then the function returns this value.
Example
You can use the IF . . . THEN . . . ELSE function when you want to sort records in an unusual order. In this example, the Customers are sorted so that those with a Balance greater than $10,000 appear first, then those with Balances between $1,000 and $10,000, and finally those with Balance of $1,000 or less:
r-ifelsf.p
|