This lesson is locked
A short preview is available. Purchase once for lifetime access.
Beginner Β· 16:04
Prototyping: DCL-PR, DCL-PI, and Passing Parameters
Lesson 24 defined subprocedures and called them within one module, where the compiler derives a prototype from the procedure interface. This lesson covers the prototype itself β DCL-PR β and the rules that govern how data crosses a call boundary: by reference, by CONST reference, and by VALUE.
What you'll be able to do
- 1Write a DCL-PR prototype and a matching DCL-PI procedure interface, and explain how the compiler uses the prototype to check every call.
- 2Distinguish passing by reference, by CONST reference, and by VALUE, and predict whether a change made by the called procedure is visible to the caller.
- 3Declare optional parameters with OPTIONS(*NOPASS) and OPTIONS(*OMIT), and test for them safely with %PARMS, %PARMNUM, and %ADDR.
- 4Prototype and call another program with EXTPGM, and a system or C procedure with EXTPROC.
- 5Declare a program's entry parameters with a DCL-PI in both a cycle-main and a linear-main program.
Create your account
Takes a few seconds β you'll be right back here after.