midrange.com code scratchpad |
Name:
OMIT and NOPASS in call chain
|
Scriptlanguage:
Plain Text
|
Tabwidth:
4
|
Date:
03/13/2011 09:13:21 am
|
IP:
Logged
|
|
Description:
Example showing how *OMIT is passed on a call chain. Specifically showing how the runtime does not check to see if a parm is passed before passing it on.
|
Code:
- d proc1 pr
- d parm1 1a
- d parm2 1a options(*omit : *nopass)
- d parm3 1a options(*omit : *nopass)
-
- d proc2 pr
- d parm1 1a
- d parm2 1a options(*omit : *nopass)
- d parm3 1a options(*omit : *nopass)
-
- d var1 s 1a inz('A')
- d var2 s 1a inz('B')
- d var3 s 1a inz('C')
-
- /free
-
- proc1(var1 : *omit : var3);
- proc1(var1 : var2);
- proc1(var1);
-
- *inlr = *on;
- return;
-
- /end-free
- **********************************************************************************************
- p proc1 b
- d proc1 pi
- d parm1 1a
- d parm2 1a options(*omit : *nopass)
- d parm3 1a options(*omit : *nopass)
-
- /free
-
- proc2(parm1 : parm2 : parm3);
-
- return;
-
- /end-free
- p proc1 e
- **********************************************************************************************
- p proc2 b
- d proc2 pi
- d parm1 1a
- d parm2 1a options(*omit : *nopass)
- d parm3 1a options(*omit : *nopass)
-
- /free
-
- return;
-
- /end-free
- p proc2 e
|
|
|