× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.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

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.