In 4GL, a function is a named collection of statements that performs a task.
The FUNCTION statement can define functions. 4GL programs can invoke the following types of functions:
The FUNCTION program block begins with the FUNCTION keyword and ends with the END FUNCTION keywords. These enclose a program block of the 4GL statements that compose the function; these are executed when the function is invoked. This is the syntax of the FUNCTION statement:
No other FUNCTION, REPORT, nor MAIN program block can be included in a FUNCTION definition, but it can include statements that produce a report, or call a function, or execute a RUN statement that invokes another program.
Syntax of Built-In Functions and Operators
Operators that are represented by non-alphabetic symbols are grouped under the headings Arithmetic Operators and Relational Operators.
BUILT-IN FUNCTIONS | BUILT-IN OPERATORS |