The Function object can be provided as a system or end-user defined object. User-defined Functions can be User Functions or Report Procedures. System Functions are, and User-defined Functions can be structured to perform small tasks within a larger task. Functions are packaged (encapsulated) mini-procedures that can then be used in construction of other Functions and Reports, where they are represented only by their original entry and exit points (Parameters and/or Return values).
This ability to downsize Procedures through the use of Functions to a narrower scope can greatly simplify construction of complex Procedures and Reports. Conceptually, it is easier to deal with a number of relatively small and simple building blocks, each of which performs a specific function, rather than to design and debug a large, convoluted Procedure that houses all calculations, data retrievals, conditions etc. that make up the logic of a Procedure.
The "Parameters" box in the Function object corresponds to the Parameters object in the body of the selected Function, and is pre-filled with the name(s) of the parameters as defined within that Function. For visual confirmation, see the corresponding Parameters object shown immediately to the right of the Function object, in our example.
The variables shown in the expanded Function object must be filled with the procedure variables that will either carry data into the Function, or bring the results of the Function's execution back into the calling procedure. Therefore, the parameter names of the Function object should be replaced with the variables from the calling procedure, where the Function is used.
In a similar way, the "Return value" box in the expanded Function object corresponds to the Return object defined in the Function, and should be filled with the variable that receives the return value from the Function.
Some Functions (in fact, all User-defined Functions and most of the System Functions) allow passing of data in the Parameters box either through the procedure variables (default setting), or by hard-coded values. Passing of data through variables is accomplished by:
If the Run-time switch is pressed, so that its color is changed to white, then the contents of the field next to the switch is interpreted as the data itself, rather than the name of the variable that carries the data.
Table of Contents