Return to the RPG Tips
Push button example source for usage
SOURCE FILE . . . . . . . BILLM/QCLSRC MEMBER . . . . . . . . . PUSHBC SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 100 PGM PARM(&PRTR) 200 DCLF FILE(PUSHBC) 300 DCL VAR(&USER) TYPE(*CHAR) LEN(10) 400 DCL VAR(&PRTR) TYPE(*CHAR) LEN(10) 500 MONMSG MSGID(CPF0000) 600 CHGVAR VAR(&FIELDP) VALUE(&PRTR) 700 RTVJOBA USER(&USER) 800 900 1000 START: SNDRCVF DEV(*FILE) RCDFMT(FMT01) WAIT(*YES) 1100 RMVMSG CLEAR(*ALL) 1200 1300 IF COND(&IN03) THEN(DO) 1400 GOTO END 1500 ENDDO 1600 IF COND(&USER *EQ '&FIELDP') THEN(DO) 1700 GOTO END 1800 ENDDO 1900 /* &F1 */ 2000 /* F6-DISPLAY MESSAGES */ 2100 IF COND(&IN06) THEN(DO) 2200 DSPMSG 2300 ENDDO 2400 /* START PRINT WRITER &FIELDP */ 2500 IF COND(&F2 *EQ 1) THEN(DO) 2600 STRPRTWTR DEV(&FIELDP) OUTQ(&FIELDP) 2700 MONMSG MSGID(CPF3310) 2800 ENDDO 2900 /* DISPLAY OUTPUT QUEUE &FIELDP */ 3000 IF COND(&F2 *EQ 2) THEN(DO) 3100 WRKOUTQ OUTQ(&FIELDP) 3200 ENDDO 3300 /* DISPLAY PRINTER MESSAGES &FIELDP */ 3400 IF COND(&F2 *EQ 3) THEN(DO) 3500 DSPMSG MSGQ(&FIELDP) 3600 ENDDO 3700 /* DISPLAY SPOOL FILE &FIELDP */ 3800 IF COND(&F2 *EQ 4) THEN(DO) 3900 WRKSPLF SELECT(*ALL &FIELDP) 4000 ENDDO 4100 4200 GOTO CMDLBL(START) 4300 4400 END: RETURN 4500 ENDPGM * * * * E N D O F S O U R C E * * * * SOURCE FILE . . . . . . . BILLM/QDDSSRC MEMBER . . . . . . . . . PUSHBC SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 100 A*%%TS SD 19980721 100055 200 A*%%EC 300 A DSPSIZ(24 80 *DS3) 400 A ERRSFL 500 A CF03(03 'Exit') 600 A CSRINPONLY 700 A R FMT01 800 A*%%TS SD 19980721 100055 900 A TEXT('PRINTER CONTROL MENU') 1000 A CA06(06 'MESSAGE') 1100 A BLINK 1200 A OVERLAY 1300 A WINDOW(4 34 10 28) 1400 A WDWTITLE((*TEXT 'PRINTER CONTROL M- 1500 A ENU')) 1600 A 2 1'PRINTER' 1700 A FIELDP 10A O 2 9DSPATR(UL) 1800 A F2 2Y 0B 4 1PSHBTNFLD((*NUMCOL 1)) 1900 A PSHBTNCHC(1 'S>TARTPRINTER' ENTER) 2000 A PSHBTNCHC(2 '>OUT QUEUE' ENTER) 2100 A PSHBTNCHC(3 '>PRINTER MESSAGES' - 2200 ENTER) 2300 A PSHBTNCHC(4 '>SPOOL FILES' ENTER) 2400 A F1 2Y 0B 9 2PSHBTNFLD 2500 A PSHBTNCHC(1 '>EXIT' CF03) 2600 A PSHBTNCHC(2 '>MESSAGES' CF06) 2700 A R DUMMY 2800 A TEXT('PREVENTS PREVIOUS SCREEN FROM- 2900 A BEING CLEARED') 3000 A ASSUME 3100 A 5 9' ' 3200 3300 3400 * * * * E N D O F S O U R C E * * * *
[report a broken link by clicking here]