Function prototypes

A function prototype is a definition that is used to perform type checking on function calls when the EGL system code does not have access to the function itself.

A function prototype begins with the keyword function, then lists the function name, its parameters (if any), and return value (if any). The prototype includes no executable code.

You can use function prototypes in the following situations:

A Delegate part conveys the same general information that a function prototype does, but in a different form (see Delegate part).

Syntax

Syntax diagram for a function prototype
functionPartName
The name of the function that this prototype describes.
parameters
A list of the parameters that the actual function uses.
type
A type that describes the value that the actual function returns. This can be a primitive type, a data item, a dictionary, or a record.

Example

The following example shows a function prototype:
ExternalType TaxModule type JavaObject
  // Define public variables
  adjustedGrossIncome FLOAT;
  companyName STRING;

  // Define function prototype
  function calculateTax (adjIncome FLOAT) returns (FLOAT);

  // Define constructor prototype
  constructor (taxAuthority STRING);
end