|
Generally I use different indicators on these, that way since I rename them I can use named indicators such as SflDspCtl, SflClr, etc. I also use a different indicator for subfile display, that way I can just turn off the subfile display indicator if no subfile records were written & just display the subfile control & footer records. Example: Sflclear = *On; Write Ctl; SflClear = *off; LoadSfl(); If rrn=0; sfldsp = *off; Else; sfldsp = *on; EndIf; Sfldspctl = *On; Write footer; Exfmt ctl; Thanks, Tommy Holden -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Michael_Schutte@xxxxxxxxxxxx Sent: Friday, May 19, 2006 2:46 PM To: RPG programming on the AS400 / iSeries Subject: RE: Window Does Not Exist? I just wanted to add one more thing. Is there an advantage to using more than one indicator. Since my very first subfile pgm, i have only used one. *IN88. Define General Keywords Subfile control record . . . . . . . . . : C1 Type choices, press Enter. Keyword Related subfile record . . . . . . . SFLCTL S1 Name Subfile cursor relative record . . . SFLCSRRRN Name Subfile mode . . . . . . . . . . . . SFLMODE Name Y=Yes Indicators/+ Display subfile records . . . . . . SFLDSP Y N88 Display control record . . . . . . . SFLDSPCTL Y N88 Initialize subfile fields . . . . . SFLINZ Delete subfile area . . . . . . . . SFLDLT Clear subfile records . . . . . . . SFLCLR 88 Indicate more records . . . . . . . SFLEND SFLEND parameter . . . . . . . . *MORE SFLEND parameter . . . . . . . . *SCRBAR *MORE ... Record not active . . . . . . . . . SFLRNA More... F3=Exit F12=Cancel Then in the RPG program, I only need. *IN88 = *On; Write C1; *IN88 = *Off; I've seen programs where people use two indicators for the same options, but I never understood why. It could be that they thought it needed to be that way. Michael Schutte Elise Langman <Elise.Langman@am o.com> To Sent by: RPG programming on the AS400 / rpg400-l-bounces@ iSeries <rpg400-l@xxxxxxxxxxxx> midrange.com cc Subject 05/19/2006 02:57 RE: Window Does Not Exist? PM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@midrang e.com> Your problem is that you haven't conditioned the SFLDSPCTL keyword. When you write to the control record to clear the subfile, it defaults to trying to display the control record - in the window - which, as the message states, doesn't exist since you haven't written that format yet. Add an indicator to the SFLDSPCTL keyword in the DDS, make sure it's off when you do the write to clear the subfile, then turn it on before you display the screen. Elise -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Captain Jerry Sent: Friday, May 19, 2006 8:30 AM To: RPG programming on the AS400 / iSeries Subject: Window Does Not Exist? Hi all, Now I've got a "strange subfile problem" ~ Must be the day for them... A small subfile test program that I have, compiles fine, but errors on the initial Write to the control-record (with SFLCLR Indicator *On, and all other's off) with "Window does not exist" (CPF500A) The Cause says "An attempt was made to display a window record in a window that is not currently being displayed." (What? LOL) It's a subfile-in-a-window thing! Oh, it also works fine if I don't do an initial clear of the subfile! If I load the subfile, execute format on the control-record, and then clear the subfile, it works fine, but that's backwards! Here's the Display file and small test only program... A R DSP12SFL SFL A 40 SFLNXTCHG A S1SEL 1A B 4 7COLOR(BLU) A S1MODEL 5A O 4 11 A S1YEAR 4S 0O 4 19 A S1DESC 40A O 4 25 A R DSP12CTL SFLCTL(DSP12SFL) A CF02 A CF24 A OVERLAY A 42 SFLDSP A SFLDSPCTL A 41 SFLCLR A 42 SFLEND(*MORE) A SFLSIZ(0320) A SFLPAG(0010) A WINDOW(DSP12RCD) A 2 6'Sel' A DSPATR(UL) A COLOR(WHT) A 2 11'Model#' A DSPATR(UL) A COLOR(WHT) A 2 19'Year' A DSPATR(UL) A COLOR(WHT) A 2 25' Description - A ' A DSPATR(UL) A COLOR(WHT) A S1POSN 5A B 3 11COLOR(BLU) A 3 17'<- Position to...' A COLOR(BLU) A R DSP12RCD A WINDOW(6 3 15 70 *NOMSGLIN) A WDWBORDER((*COLOR WHT) (*DSPATR HI - A RI) (*CHAR '+-+||+-+')) A 15 7'F2=Return' A COLOR(BLU) A 15 19'F24=Process' A COLOR(BLU) ===================================================================== fwkd111c_svcf e workstn sfile(dsp12sfl:rrn12) d rrn12 s 4 0 /free *in41 = *on; clear *in42; write dsp12ctl; <- Errors here.... clear *in41; s1model = 'xxxxx'; for rrn12 = 1 to 20; <- Just to load the subfile with test data. write dsp12sfl; endfor; *in42 = *on; write dsp12rcd; exfmt dsp12ctl; if *inkb; *inlr = *on; endif; /end-free -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
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.