プロトタイプとともに使用される %PADDR

%PADDR の引数はプロトタイプ名であっても構いませんが、次の制約事項があります。

図 214. プロトタイプとともに使用される %PADDR の例
 *----------------------------------------------------------------
 * Several prototypes
 *----------------------------------------------------------------
D proc1           PR
D proto2          PR                  EXTPROC('proc2')
D proc3           PR                  EXTPROC(procptr3)
D pgm1            PR                  EXTPGM('PGM3')
D meth            PR                  EXTPROC(*JAVA : 'myClass'
D                                           : 'meth1')

D procptr3        S               *

 *----------------------------------------------------------------
 * Valid examples of %PADDR with prototype names as the argument
 *----------------------------------------------------------------

 * constant1 is the same as %PADDR('PROC1') since 'PROC1' is the
 * procedure called by the prototype proc1
D constant1       C                   %PADDR(proc1)

 * constant2 is the same as %PADDR('proc2') since 'proc2' is the
 * procedure called by the prototype proto2
D constant2       C                   %PADDR(proto2)

 * %paddr(proc3) is the same as procedure pointer procptr3 since
 * procptr3 points to the procedure called by prototype proc3
C                   eval      procptr = %paddr(proc3)

 *----------------------------------------------------------------
 * Examples of %PADDR with prototype names as the argument
 * that are not valid
 *----------------------------------------------------------------
 * %PADDR(pgm1) is not valid because it is a prototype for a program
 * %PADDR(meth) is not valid because it is a prototype for a Java method