Progress
Language Tutorial
for Windows


Understanding Expressions

An expression is a combination of 4GL language elements that results in a single value. At a minimum, an expression consists of one operand, but can include multiple operands, operators, and functions.

An operand is a language element that represents a value. Operands include:

An operator is a language element that represents an action carried out on one or more operands. The successful combination of operands and operators, called an operation, always returns a value. For example, the equal sign (=) is a 4GL operator that assigns the value from the right side of the operator to the field or variable on the left side of the operator. The plus sign (+) is another operator that adds the operands on either side of the operator and returns the result.

A function is a prewritten program that performs a specific task and returns a value. A function is like an operand in that it represents a value, but it is also like an operator in that it represents an action. You can think of a function as a prepackaged solution to a task that can be used in an expression. Because the code already exists, either as a pre-defined function or one that you create as a user-defined function, it offers a shortcut to providing a programmed solution to a coding task or problem.

Progress supports pre-built Progress-supplied functions and user-defined functions. The 4GL contains many functions that perform a wide range of common tasks. For example, the ASC(character) function returns the ASCII integer code for a supplied character. Also, you can use the FUNCTION statement to create specific functions that suit your programming needs.

The sections that follow provide more information about expression components.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095