|
Hi Dave, See if this can help. The complete code is too big. I'm sending the code which displays the most recent subfile upon pressing F4 from previous display record. This subfile is enclosed in a window and also uses a message subfile based on the window. *------------------------------------------------------------------- * S14004 - If F4 pressed, show list of all gangs for the date * with same department and show. *-------------------------------------------------------------------- C S14004 BEGSR *-------------------------------------------------------------------- * * Initialize variables * C MOVEA*IN,01 IN Save Indicators. C Z-ADD1 $SRN20 40 RRN C MOVE '1' *IN52 SFLDSPCTL C MOVE '1' *IN54 SFLEND C MOVE 'N' #TLEXT 1 Exit the List. C $SDATE MULT 10000.01 @PDATE Gang Date C Z-ADD$SCENT @PCENT and Century. * * Write Window * C WRITEWINREC20 * * Clear Subfile. * C MOVE '1' *IN53 C WRITESFLCTL02 C MOVE '0' *IN53 * * Populate Subfile. * C TRLKY1 SETLLGNGHDRL1 51 * C *IN51 IFEQ '1' * C *IN55 DOWEQ'0' * C TRLKY1 READEGNGHDRL1 55 * C *IN55 IFEQ '1' C LEAVE C ENDIF * C Z-ADDGHGANG $SGNGL Gang No. C Z-ADDGHDATE $SDATL Gang Date C MOVELGHDEPT $SDEPL Department C MOVELGHSHOW $SSHWL Show C MOVELGHSCID $SSIDL Schedule ID C MOVELGHDESC $SDESL Gang Description C MOVELGHDAPR $SDAPL Gang Owner C MOVELGHUSED $SINFL Gang in use flag C MOVELGHUSRL $SINUL Gang in use By C WRITESFLRCD02 C ADD 1 $SRN20 * C ENDDO * C ENDIF * * Write Subfile. * C #TLEXT DOWEQ'N' * C WRITEWINREC20 C WRITESFLCT100 Message Subfile C EXFMTSFLCTL02 C EXSR S90001 Clear msg q. * * Handle Function Keys. * C SELEC * C @DFKEY WHEQ ENTER C $SCN20 IFGT 0 C MOVEL$SDEPL $STDPT C MOVEL$SSHWL $STSHW C MOVEL$SDAPL $STUSR C Z-ADD$SGNGL $STGNG C MOVEL$SSIDL $STSID C MOVE 'Y' #TLEXT C ELSE C MOVEL'ADC2605' @PMID Incorrect Cur Loc. C EXSR S90000 C ENDIF * C @DFKEY WHEQ F3 C @DFKEY OREQ F12 C MOVE 'Y' #TLEXT * C ENDSL * C ENDDO * C MOVEAIN *IN,01 * C ENDSR Fields : $SGNGL $SDATL $SDEPL $SSHWL $SSIDL $SDESL $SDAPL $SINFL $SINUL are in current subfile SFLRCD02. Where as fields: $STDPT $STSHW $STUSR $STGNG $STSID are in previous display from which on pressing F4, the current subfile is displayed. Thanks, Rajeev. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This is the RPG/400 Discussion Mailing List! To submit a new * * message, send your mail to "RPG400-L@midrange.com". To unsubscribe * * from this list send email to MAJORDOMO@midrange.com and specify * * 'unsubscribe RPG400-L' in the body of your message. Questions should * * be directed to the list owner / operator: david@midrange.com * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.