|
Hi I have written programs CLP&RPGLE to give an option to User to select Yes/No options. Yes option will give him print and No option will send an email to him. Can some one try to advise me on how can I eliminate indicators and replace with builtin functions in my code, is there anyway still i can reduce my code...if possible pls answer..this code what I ve written is working for me but nt looking beautiful.. ======================= YYESNOC:CLP ------------------ PGM PARM(&YESORNO) 0004.04 DCL VAR(&YESORNO) TYPE(*CHAR) LEN(1) VALUE(N) 0005.00 DCL VAR(&REPLY) TYPE(*CHAR) LEN(1) 0007.00 CALL PGM(YYESNOR) PARM(&REPLY) 0008.00 IF (&REPLY *EQ 'Y') THEN(DO) 0009.00 CHGVAR VAR(&YESORNO) VALUE('Y') 0010.00 ENDDO 0011.00 IF (&REPLY *EQ 'N') THEN(DO) 0011.01 CHGVAR VAR(&YESORNO) VALUE('N') 0013.00 ENDDO 0014.00 0015.00 ENDPGM ---------------------- YYESNOR:RPGLE : FYYESNO CF E WORKSTN 0005.00 C MOVE 'N' REPLY 0006.00 C AG1 TAG 0007.00 C *ENTRY PLIST 0008.00 C PARM RPLY 1 0009.00 C EXFMT DSPLY 0010.00 C SETOFF 99 0011.00 C *IN03 IFEQ '1' 0012.00 C GOTO BOTTOM 0013.00 C ELSE 0014.00 C EXSR VALID 0015.00 C N99 MOVE REPLY RPLY 0016.00 C 99 GOTO AG1 0017.00 C END 0018.00 C BOTTOM TAG 0019.00 C** 0020.00 C MOVE '1' *INLR 0021.00 C** 0022.00 C***************************************************************** 0023.00 C* SUBROUTINE TO VALIDATE REPLY ENTERED ON SCREEN ** 0024.00 C***************************************************************** 0025.00 CSR VALID BEGSR 0025.01 C REPLY IFEQ ' ' 0025.02 C MOVE 'N' REPLY 0025.03 C ENDIF 0026.00 C REPLY IFNE 'Y' 0027.00 C REPLY ANDNE 'N' 0028.00 C REPLY ANDNE 'y' 0029.00 C REPLY ANDNE 'n' 0030.00 C *IN03 ANDNE '1' 0031.00 C SETON 99 0032.00 C END 0033.00 CSR ENDSR
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.