1.3.5 Defining a Function

The FUNCTION keyword permits the creation of personal keywords by encapsulating some logic as a function and giving it a name. This name can then be used in a logic equation to represent the function. The format for user-defined functions is as follows:
  FUNCTION name ([Parameter0,...,Parametern])
  {   body   }

The statements in the body may assign an expression to the function or may be unrelated equations.

When using optional parameters, the number of parameters in the function definition and in the reference must be identical. The parameters defined in the body of the function are substituted for the parameters referenced in the logic equation. The function invocation variable is assigned an expression according to the body of the function. If no assignment is made in the body statements, the function invocation variable is assigned the value of ‘h’0.