A function-invocation statement calls an EGL-generated function
or a system function. When the called function ends, processing continues
either with the statement that follows the call or (in complex cases)
with the next process required in an expression or in a list of parameters.
The function can be qualified with the name of a library or package,
or with the keyword this. For more on when
these qualifiers are required, see Scope
You can pass the following kinds of arguments to a function:
- a literal
- a constant
- a variable
- a more complex numeric, text, or date/time expression, potentially
including a function invocation or substring
- a reference variable or an expression that evaluates to a reference
If the called function returns a value, you can use the invocation
anywhere that you otherwise use the value that the function returns.
For example, you can use a function in a conditional statement, as
in the following example:
if(getCustomer())
...
end
A BOOLEAN function that returns TRUE or a numeric function that
returns a non-zero value passes the test.
You can use a literal as an argument if the access modifier is in or inOut.
(Note that if the modifier is inOut, the
argument is treated as if the in modifier
were in effect.) 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.
If the parameter is a structured record, the argument must be a
structured record.
- The following rules apply to structured records that do not have
the BasicRecord stereotype:
- The type of the parameter and argument must be identical
- The access modifier must be inOut
- For structured records that have the BasicRecord stereotype, the
type of the parameter and argument can vary:
- If the access modifier is in, the size
of the argument you pass must be greater than or equal to the size
of the receiving parameter.
- If the access modifier is Out or inOut,
the size of the argument you pass must be less than or equal to the
size of the receiving parameter.