Function call and parameter passing Foundation
When a procedure or UDF is declared using the keywords PROCEDUREor FUNCTION, the corresponding section of program code is executed whenever the declared identifier appears in the program followed by parentheses. The parentheses cause the function or procedure to be called and are the "execution operator". Within the parentheses, arguments can be passed to the procedure or function. The arguments are accepted into variables specified in the formal parameter list of the declaration. The parameter list can be specified in the declaration either as a list of identifiers in parentheses or using the keyword PARAMETERS (see the chapter "Arguments and parameters").
When a procedure or UDF is called, the number of arguments may differ from the number of parameters declared. Each function and procedure can be called with no arguments or with a varying number of arguments. When an argument is not specified in the call to a UDF or procedure, the corresponding parameter contains the value NIL. The following program example illustrates this:
The program example results in the following:
Arguments are specified as a comma separated list enclosed in parentheses in calls to functions or procedures. When no argument is specified after a comma, the value NIL is passed instead of an argument and the matching parameter receives this value. A procedure or function is specified without an argument by including nothing inside the parentheses (for example, Show()). As soon as a single comma appears inside the parentheses, two arguments are passed. For example, Show(,) passes two arguments both containing the value NIL(see the function PCount() in the reference documentation).
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.