|
Ah! I missed that! I think you are right, now that I reread that. Good eyes! :-) The way that I would do this then is to use a data queue and the INVITE keyword to auto-update the subfile as records are added. You can let the display file refresh itself, with no user input required, by placing the data that goes into the subfile onto a dataqueue (which is attached to the display file at compile time) and then pop them off as they appear on the data queue and write them to the display. You could even write the subfile data to the data queue from the same program if you wanted although that'd kind of defeat the purpose, I'd think. This example is also in the book listed at the link: "The MC Press Desktop Encylopedia for iSeries and AS/400" http://www.mc-store.com/5027.html FTPLOGD1 - DSPF A************************************************************** A* A* CRTDSPF FILE(XXX/FTPLOGD1) SRCFILE(XXX/QDDSSRC) + A* MBR(FTPLOGD1) DTAQ(QGPL/FTPLOG) A* A************************************************************** A DSPSIZ(24 80 *DS3) A PRINT A 75 INVITE A CA03(03 'exit') A CA05(05 'REFRESH') A R FTPLOGS1 SFL A ACTION 30A O 4 4 A OBJECT 30A O 4 36 A FTPUSR 10A O 4 68 A 5 5'From IP Address:' A DSPATR(HI) A IPADR 18A O 5 22 A 5 42'Time:' A DSPATR(HI) A CTIME T 5 48 A R FTPLOGC1 SFLCTL(FTPLOGS1) A OVERLAY A 91 SFLDSP A 90 SFLDSPCTL A 89 SFLCLR A 99 SFLEND(*MORE) A SFLDROP(CA09) A SFLSIZ(0010) A SFLPAG(0009) A 50 ERASE(FTPLOGS1) A 1 3TIME A 1 32'FTP ACTIVITY LOG' A DSPATR(HI) A DSPATR(UL) A 1 69DATE A EDTCDE(Y) A 3 4'FTP Action' A DSPATR(HI) A 3 36'Against Object' A DSPATR(HI) A 3 68'FTP User ' A DSPATR(HI) A R FTPLOGF1 A OVERLAY A 24 4'F3=Exit' A COLOR(BLU) A 24 14'F5=Refresh' A COLOR(BLU) A 24 27'F9=IP Address/Time' A COLOR(BLU) A 24 49'F17=Top' A COLOR(BLU) A 24 60'F18=Bottom' A COLOR(BLU) FTPLOGR1 - RPG *================================================================ * To compile: * * CRTBNDRPG PGM(XXX/FTPLOGR1) SRCFILE(XXX/QRPGLESRC) * DFTACTGRP(*NO) * **************************************************************** * * **************************************************************** FFtplogd1 CF E WORKSTN SFILE(FTPLOGS1:RRN1) * D Event S 5a D DataLen S 5P 0 D DqData S 2000a D DqDlen S 5 0 D DqKey S 20a D DqWait S 5P 0 D DqName S 10a D DqLib S 10a D Rrn1 S 4 0 C Exsr ClrSfl C Dow *In03 = *Off * Invite C Eval *In75 = *On C Write Ftplogc1 C CALL 'QRCVDTAQ' C PARM 'FTPLOG' DqName C PARM 'QGPL' Dqlib C PARM DqDlen C PARM *BLANKS DqData C PARM -1 Dqwait C If DqDlen <> 0 C Eval Event = %Subst(Dqdata:1:5) * If data queue entry comes from the display file, check indicators, otherwise * write data to display file C If Event = '*DSPF' C Eval *IN75 = *Off C Read Ftplogc1 * Exit C If *In03 = *On C Leave C Endif * Refresh C If *In05 = *On C Eval *In50 = *On C Exsr ClrSfl C Eval *In50 = *Off C Endif C Else C Eval *In75 = *Off * Extract User C Eval Ftpusr = %Subst(Dqdata:1:10) * * Extract IP Address C Eval Ipadr = %Subst(Dqdata:11:18) * * Extract Action C Eval Action = %Subst(Dqdata:43:30) * * Extract Object C Eval Object = %Subst(Dqdata:83:30) * C Time CTime * C Write Ftplogc1 C Eval Rrn1 = Rrn1 + 1 C Write Ftplogs1 C Eval *IN91 = *On C Endif * C Endif * C Enddo C Eval *Inlr = *On ************************************************************************** * Initialize subfile and display empty subfile ************************************************************************** C ClrSfl Begsr C Eval *In89 = *On C Eval *In90 = *Off C Eval *In91 = *Off C Eval *In75 = *Off C Write Ftplogc1 C Eval Rrn1 = 0 C Eval *In89 = *Off C Eval *In90 = *On C Eval *In91 = *Off C Eval *In75 = *On C Write Ftplogc1 C Write Ftplogf1 C Endsr -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of RPower@xxxxxxxxxx Sent: Thursday, May 26, 2005 12:10 PM To: RPG programming on the AS400 / iSeries Subject: RE: Processing... Please Wait... But with a subfile I think he got that already. What he wants from the looks of it, is to show each subfile record as it is written, in the case of a large subfile being loaded so the user can see what's happening I think. Ron Power Programmer Information Services City Of St. John's, NL P.O. Box 908 St. John's, NL A1C 5M2 Tel: 709-576-8132 Email: rpower@xxxxxxxxxx Website: http://www.stjohns.ca/ ___________________________________________________________________________ Success is going from failure to failure without a loss of enthusiasm. - Sir Winston Churchill "Shannon ODonnell" <sodonnell@xxxxxxxxxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx 26/05/2005 02:20 PM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To "'RPG programming on the AS400 / iSeries'" <rpg400-l@xxxxxxxxxxxx> cc Subject RE: Processing... Please Wait... But with a subfile The way I do that, and it works pretty well for me, is to create a display file that has two record formats in it. One is the message you want to display (Processing...busy...whatever...) and which has the OVERLAY keyword at the record level. Let's call it S1 A R S1 A OVERLAY A B 2 60 'PROCESSING' The second record format looks like this: A DSPATR(HI) A R DUMMY A KEEP A ASSUME A OVERLAY A DUMFLD 1A O 13 79 *************** End of data ************************ In your RPG program, wherever you want to display your "processing" message, simply do this: C Write S1 Then do any other processing you want. When your subfile is built, you can then write it out like you normally do and continue on. The S1 format will disappear, (be overwritten) by the subfile control record and subfile record formats. BTW...you can find this tip and about 900 others just like it here: "The MC Press Desktop Encylopedia for iSeries and AS/400" http://www.mc-store.com/5027.html HTH -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Kurt Anderson Sent: Thursday, May 26, 2005 11:41 AM To: RPG programming on the AS400 / iSeries Subject: Processing... Please Wait... But with a subfile I just read the thread about informing the user that processing is occurring. My options include sndpgmmsg or issuing a Write (w/FrcDta keyword on record format). I want to go with the latter, and I'm looking to do a little bit more. I'd like to display a subfile as it's being built w/o waiting for the user. Essentially the user would see the 'processing...' message above the subfile column headings, but would also see any exception messages pop up at the same time. At the end, the window footer would display command keys appropriate to the result of the processing. My window is as such: * subfile A R WdwSfl * subfile control (header) A R WdwCtl SflCtl( WdwSfl ) A Window(Wdw) A FrcDta A 96 SflDsp A N98 SflDspCtl A 98 SflClr A 96 SflEnd( *ScrBar ) * window definition (footer) A R Wdw In the code: // build record to write to subfile SflClr = *Off (in98) WdwSflDsp = *On; (in96) WdwRRN += 1; Write WdwSfl; Write WdwCtl; <------- error Write Wdw; If I remove the error statement, I only get a window (subfile is not displayed). Thanks, Kurt Anderson Application Developer Highsmith Inc. W5527 State Road 106, P.O. Box 800 Fort Atkinson, WI 53538-0800 TEL (920) 563-9571 FAX (920) 563-7395 EMAIL kjanderson@xxxxxxxxxxxxx
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.