Previous Topic Next topic Print topic


Arguments and Parameters

Arguments are references or expressions in the invocation (CALL statement or function reference) of the procedure. Parameters are names by which those arguments can be accessed in the invoked procedure.

By default, arguments are passed by reference. In this case, any change to the parameter is reflected back in the argument, assuming the argument is a reference that has not caused a temporary argument to be created. Such argument/parameter pairs can be input (to the invoked procedure) only, output (from invoked procedure) only, or input and output.

Another way to pass arguments is BYVALUE. BYVALUE arguments are more efficient, but any change to the parameter is never reflected back in the argument. Thus, such argument/parameter pairs are input (to the invoked procedure) only.

Most suitable arguments that can or should be passed BYVALUE are those that fit in a 4-byte (32-bit) or 8-byte (64-bit) field, which can in some cases be passed in machine registers. FIXED BIN, FLOAT, and POINTER are the most common data types that are passed BYVALUE.

Previous Topic Next topic Print topic