Parameter-Passing Considerations

When designing a call interface, you must make a number of decisions in terms of how parameters will be passed. On the other hand, if you are the caller then most of the decisions have already been made for you. The following lists some of the parameter-passing considerations to keep in mind when you are designing a call interface.

Table 1 associates the above considerations with the two types parameters: prototyped or non-prototyped.

Table 1. Parameter Passing Options
Parameter Option Prototyped

Not
Prototyped

See Page
Compile-time parameter checking Yes   Passing Prototyped Parameters
Pass by reference Yes Yes Passing by Reference
Pass by value Yes (b)   Passing by Value
Pass by read-only reference Yes   Passing by Read-Only Reference
Pass operational descriptors Yes (b) Yes (b) Using Operational Descriptors
Pass *OMIT Yes Yes (b) Omitting Parameters
Control parameter omission Yes Yes Leaving Out Parameters
Get number of passed parameters Yes Yes Checking for the Number of Passed Parameters
Disallow incorrect parameter length Yes   Passing Less Data Than Required
Pass file parameters Yes   Passing File Parameters
Note: (b) – applies to bound procedures only.

Feedback