Programmer-defined 4GL functions

FUNCTION program block begins with the FUNCTION keyword and ends with the END FUNCTION keywords. These keywords enclose a program block of the 4GL statements that compose the function, and that are executed when the function is invoked.

Description: FUNCTION%20Program%20Block

argument

the name of a formal argument to the function

function

the identifier declared here for the function

statement

a SQL statement or other 4GL statement

The left-hand side of this diagram, comprising the function identifier and its list of arguments, is sometimes called the function prototype.

The names of functions cannot be the same as any other reports or global variables within the program, or any of the formal arguments of the same function.

The right-hand side of the diagram, which comprises the declarations of formal arguments and any local variables, and the statement block, is sometimes called the FUNCTION program block. This part can include any executable statement of SQL or 4GL except the report execution statements.

The whole FUNCTION program block must be defined within a single source module. No other FUNCTION, REPORT, or MAIN program blocks can be included in a FUNCTION definition. However, that definition can include statements that create a report, call a function, or execute a RUN statement that invokes another program.

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.