Function invocations

A function invocation runs an EGL-generated function or a system function. When the invoked function ends, processing continues either with the statement that follows the invocation or (in complex cases) with the next process required in an expression or in a list of arguments.


Syntax diagram for function invocation
qualifier
One of the following symbols:
  • The name of the library in which the function resides; or
  • The name of the package in which the function resides, optionally followed by a period and the name of the library in which the function resides.
  • this (identifies a function in the current program)

For details on the circumstances in which the qualifier is unnecessary, see References to parts.

function name
Name of the invoked function.
argument
One of the following:
  • Literal
  • Constant
  • Variable
  • A more complex numeric, text, or datetime expression, potentially including a function invocation or substring; however, the access modifier for a non-reference parameter must be IN

You can pass a reference variable or an expression that evaluates to a reference, as noted in Reference variables and NIL in EGL.

The effect on a non-reference variable that is passed as an argument to an EGL-generated function depends on whether the corresponding parameter is modified with IN, OUT, or INOUT. For details, see Function parameters.

If the invoked function returns a value, you can use the invocation in these ways:

When the access modifier of a parameter is IN or OUT, the compatibility rules are as described in Assignment compatibility. When the access modifier of a parameter is INOUT or when the parameter is in the onPageLoad function of a pageHandler, the compatibility rules are as described in Reference compatibility.

Other rules also apply:
literals
If the access modifier is IN or INOUT, you can code a literal as the argument. The EGL-generated code creates a temporary variable of the parameter type, initializes that variable with the value, and passes the variable to the function.
fixed record
If the argument is a fixed record, the parameter must be a fixed record.
The following rules apply to fixed records that are not of type basicRecord:
  • The type of the argument and parameter must be identical
  • The access modifier must be of type INOUT
In relation to fixed records that are of type basicRecord, the type of the argument and parameter can vary:
  • If the access modifier is of type IN, the size of the argument must be greater than or equal to the size of the parameter.
  • If the access modifier is of type OUT or INOUT, the size of the argument must be less than or equal to the size of the parameter.

Related concepts
Function part
References to parts
Syntax diagram for EGL statements and commands

Related tasks
Assignments

Related reference
Assignment compatibility in EGL
EGL statements
Function parameters
Function part in EGL source format
Primitive types
Reference compatibility in EGL
Reference variables and NIL in EGL

Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.