× 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.



100% of our subfile programs use the following logic.

\\ *in10 SFLDSP
\\ *in20 SFLDSPCTL

Write Screen
*in10 = (Sflrrn > 0);
*in20 = *on;
Exfmt ScreenCtlRcd
*in20 = *off;
*in10 = *off


-----Original Message-----
From: Bryce Martin [mailto:BMartin@xxxxxxxxxxxx]
Sent: Monday, March 21, 2011 11:15 AM
To: RPG programming on the IBM i / System i
Subject: RE: Best practice for displaying an empty subfile

I know this thread is about a month old, but I just had the opportunity to
try this out and it didn't work for me. I'm not sure exactly what I am
doing wrong.

SFLDSP = *off when I write the NRCDFMT. I used the exact DDS that you
provided.

if mrrrn <> 0;
saverrn = mrrrn;
sfldsp = *on;
else;
write(E) NRCDFMT1;
endif;

A R NRCDFMT1
A OVERLAY
A 6 19'NO RECORDS FOUND'
A DSPATR(HI)

If you'd like to see anything else, just let me know. The program loads
up just fine w/o error and there are no subfile records to be written. I
debug the code and it does the Write(E) NRCDFMT1; I tried it w/o the (e)
and it doesn't error out, it just doesn't show up on the screen.


Thanks
Bryce Martin
Programmer/Analyst I
570-546-4777



"Monnier, Gary" <Gary.Monnier@xxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
02/17/2011 05:29 PM
Please respond to
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>


To
"RPG programming on the IBM i / System i" <rpg400-l@xxxxxxxxxxxx>
cc

Subject
RE: Best practice for displaying an empty subfile






Have you tried writing a blank record to the subfile?

You can also write a "No Records Found" record format overtop the
subfile display area. Here's a broad example.

Display file record format NRCDFMT overlays the screen area where
subfile records would be displayed.

A R NRCDFMT
A OVERLAY
A 15 19'No Records Found'
A DSPATR(HI)

Code snippet...

// rrnInSfl is incremented each time a record is written to the subfile

D rrnInSFL S 4S 0 like(SFRRN)

/free
.
.
.
if (rrnInSFL <= 0); // No entires to display
write(E) NRCDFMT; // No entries found record
endif;

write(E) FUNCTNKEY; // Function keys record

write(E) ERRMSGSFLC; // Put messages to the screen

exfmt SUBFILECTL; // Subfile control record
.
.
.
/end-free

Writing the NRCDFMT assumes the SFLDSP keyword is not active.

Hope this helps

Gary Monnier

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Pete Helgren
Sent: Thursday, February 17, 2011 2:06 PM
To: RPG Midrange Discussion
Subject: Best practice for displaying an empty subfile

I have an program that displays records in a subfile and it works great,

until there are no records to display. In that case it crashes with a
predictable RNQ1255. I set off the subfile display indicator before I
EXFMT when I have no records to display so I am wondering if there is
other logic I need to add so I can at least display the empty subfile
screen.

Thanks


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.