4GL Built-In Functions and Operators Overview

Functions in INFORMIX-4GL Programs

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:

Programmer-Defined 4GL 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:

4GLREF00000058.gif

Names of functions must be unique among the names of functions, reports, and global variables within the program, and cannot be the same as formal arguments of the same function.

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 
ARG_VAL( ) FGL_LASTKEY( )
AND LINENO
ARR_COUNT( ) LENGTH( ) ASCII MATCHES
ARR_CURR( ) MAX( ) BETWEEN...AND
MDY( )
AVG( ) MIN( ) CLIPPED MONTH( )
COUNT(*) NUM_ARGS( ) COLUMN NOT
DOWNSHIFT PERCENT(*) CURRENT OR
ERR_GET( ) SCR_LINE( ) DATE PAGENO
ERR_PRINT( ) SET_COUNT( ) DATE( ) SPACE
ERR_QUIT( ) SHOWHELP( ) DAY( ) TIME
ERRORLOG( ) STARTLOG( ) EXTEND( ) TODAY
FGL_DRAWBOX( )
SQLEXIT( ) FIELD_TOUCHED( )
UNITS
FGL_GETENV( ) SUM( ) GET_FLDBUF( ) USING
FGL_KEYVAL( ) UPSHIFT( ) IN( ) WEEKDAY( )
   INFIELD( ) WORDWRAP
   IS NULL YEAR( )
   LIKE