OWBasic for Pocketviewer

Home INTRO Group CONTROL Alphabetical Index

Definition of Parameters of Procedures and Functions

The parameter list describes the parameters of a user defined procedure or function. The description in the parameter list defines their type and call mode and gives them a formal name. This name is used within the procedure for the parameter.
PROC foo A,B#,VAR C
...
FUNC bar(A,B#,VAR C)
...
The type is determined similarly to variables from the suffix. Without suffix the standard type is assumed.

Without further indication the parameters are value parameters (in the example the parameters A and B). That means, that with a call to hte procedure or function values are passed through, which can be used in the procedure. Modifications of these values have no effect on the variables of the main program.

Variable parameters are marked by the keyword VAR (parameter C in the example). Here with the call a variable of the calling program is transferred. Modifications to this parameter really modify the transferred variable.

Arrays require special attention as procedure parameters

Home INTRO Group CONTROL Alphabetical Index