Function prototypes

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. The prototype allows EGL to perform type checking on function calls without having direct access to the function itself.

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

Feedback