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



I use Remove Program Message API:
QMHRMVPM('*':1:*Blank:'*ALL':ErrDS);

-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Javier Sánchez
Sent: Wednesday, February 12, 2020 21:08
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: Using a Message Subfile with no SFLINZ

Good day,

According to the documentation in the IBM's DDS for Display Files, there are two ways of using a message subfile for sending messages to the screen, typically on the bottom line.

I have used it with the SFLINZ keyword in the control subfile record, and that has worked fine. But in order to get rid of the message text, you have to remove the corresponding messages that have been sent to the program's message queue.

Trying to use the message subfile with no SFLINZ, requires you to use a variable for the RRN, needed to write to the subfile record format. I am using such option this way: I start with a list, displaying a regular subfile with some records on the screen. Then with F6=Add Record I EXFMT another screen for entering some data, and with F1 have a new record added to my database file. If I detect that an error, I send the error message to the message subfile, which is displayed as I want. When I correct all the errors, I clear the message subfile and if everything is correct, the message subfile doesn't show again, which is what I want. Hitting F1, I write a new record in my database file, and then I send an *INFO message type to the message subfile telling the user that one additional record has been succesfully inserted. With F12 I get back to the original subfile.
But the message subfile keeps being displayed, even though I control it with the OVERLAY keyword conditioned by an indicator and also I clear the message subfile.

The only reason for wanting to use this way the message subfile, is beacause I don't want to remove the messages in the program's message queue.

I only use SFLDSP, SFLDSPCTL, OVERLAY in the control record, and only use the message key, and program queue keywords in the subfile records. All three keywords in the control record are conditioned by indicator 91 which I turn on when displaying the record and then turn off when clearing the message subfile. The SFLCLR keyword is conditioned by indicator 92 which of course I turn on when writing to the control record and then turn off after the write operation.

Message subfile:
MSGSFL SFL SFLMSGRCD(24)
MSGKEY SFLMSGKEY
MSGQUE SFLPGMQ

Message subfile Control record:
MSGCTL SFLCTL(MSGSFL)
91 OVERLAY
91 SFLDSP
91 SLFCTLDSP
92 SFLCLR
91 SFLEND

The message subfile keeps showing the last text message sent to the Add Record screen, and I supposedly CLEARED it when displaying the other regular subfile.

What am I doing wrong?

Thanks.
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com

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.