H DFTNAME(TESTSIZ) DATEDIT(*YMD/) BNDDIR('QC2LE') F********** 効果的な組込み関数 %SIZE の使い方 ************************* F* F********************************************************************** * CRTBNDRPG PGM(OBJLIB/TESTSIZ) SRCFILE(SRCLIB/QRPGLESRC) DFTACTGRP(*NO) * ACTGRP(*NEW) DBGVIEW(*SOURCE) AUT(*ALL) D APIERR DS QUALIFIED D GETBYT 1 4B 0 INZ(160) D AVLBYT 5 8B 0 INZ(0) D APIID 9 15 D APIDTA 17 160 *( API : QMHRCVPM: プログラム・メッセージの受取りの定義 ) D QMHRCVPM PR EXTPGM('QMHRCVPM') D MSGINFO 32767 OPTIONS(*VARSIZE) D MSGLEN 10I 0 CONST D FORMAT 8A CONST D CALLSTK 4096A CONST D CALLSTKCNT 10I 0 CONST D MSGTYPE 10A CONST D MSGKEY 4A CONST D WAITTIME 10I 0 CONST D ACTION 10A CONST D APIERR LIKEDS(APIERR) D OPTIONS(*VARSIZE) D CALLSTKLEN 10I 0 CONST OPTIONS(*NOPASS) D CALLSTKQUAL 20 CONST OPTIONS(*NOPASS) D MSGINFO S 32767A D MSGLEN S 10I 0 D CALLSTKCNT S 10I 0 D CALLSTKLEN S 10I 0 D MSGTYPE S 10A D MSGKEY S 4A D COUNT S 10I 0 INZ(0) D WTTIME S 10I 0 INZ(0) D DS 1024 D VALUE# 1 2 D VALUE 1 1024 C EVAL MSGLEN = %SIZE(MSGINFO) +C*----------------------------------------------------+ C CALL 'QMHRCVPM' C PARM MSGINFO C PARM MSGLEN C PARM 'RCVM0200' FORMAT 8 C PARM '*' STACK 10 C PARM COUNT C PARM '*LAST ' MSGTYPE 10 C PARM MSGKEY 4 C PARM WTTIME C PARM '*SAME ' LEAVE 10 C PARM APIERR +C*----------------------------------------------------+ /FREE QMHRCVPM(MSGINFO:%SIZE(MSGINFO):'RCVM0200':VALUE:CALLSTKCNT: MSGTYPE:MSGKEY:0:'*SAME':APIERR: CALLSTKLEN:'*NONE *NONE '); /END-FREE C SETON LR C RETURN