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



They can't be using subfile messages then.
On Apr 24, 2015 6:34 PM, "Bob Cagle" <bcagle@xxxxxxxxxxx> wrote:

Booth

That's an interesting concept. But getting this message subfile to work
with subprocedures has become a personal quest of mine. :)

Besides, if I were to go a different route, since we are a JDE World shop,
I would mimic how JDE does it to match their system.

But, I don't like how JDE does it: all the fields in error turn red and
you press F7 to get to a separate screen where the errors are listed. Yuck!

Thanks

Bob Cagle
IT Manager
Lynk, Inc.

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Booth
Martin
Sent: Friday, April 24, 2015 3:14 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Interactive screen logic, Message subfiles, and the program
stack

One solution that I have used, and liked, is to replace the error-line
message with a message window that prominently displays on the screen. I
have never been a fan of the red X and the White X.

Use a cascading process to offset the windows if there are multiple
messages.

http://martinvt.com/Code_Samples/Message_Window/message_window.html

On 4/24/2015 1:42 PM, Bob Cagle wrote:
It seems this subject has been discussed ad-nauseam, but yes, this again:

I recently converted my messaging routines to service programs and
switched to using sub-procedures vs subroutines and was having trouble
getting the everything to work.

With the help of older posts here on the list and some others examples
(thanks Alan Campin and your Trigger Mediator code), I finally got
everything working.

Now I'm just trying to understand something, hope I explain this well
enough:

I have a module with a 'ProcessScreen' procedure that is just
controlling the flow and calls subprocedures for everything, like so:


Dcl-proc ProcessScreen;

Init();

DOU Key = F3:
Display();
IF Not FunctionKeyPressed();

IF ValidInput();
Process();
ENDIF;
ENDIF;
ENDDO;

End-proc;


Obviously, the screen logic is buried in the Display() subprocedure:

Dcl-proc Display;
Write MSGCTL01;
Exfmt SC01;
MSG_Clear( Procedure:Module:Program ); End-proc;


Error messages are thrown in both the FunctionKeyPressed and ValidInput
subprocedures.

I manually set the Procedure variable to be 'ProcessScreen' and pull the
module and program names from the program status data structure. And I set
the SLPGMQ on the message subfile to '*'.

What I have found with this structure is that even though the messages
show in the joblog, they will not display in the message subfile.

But when I get rid of the Display() subprocedure and move the display
logic to ProcessScreen, voila, it works.

Pretty sure this has to do with the program stack. How would I make the
message subfile work with the display logic in a 'sub' subprocedure? I did
try changing the procedure variable to 'Display', but received the 'call
stack entry not found' error.

So what's the answer here - am I just stuck with the having the display
logic in the top-level procedure? Not that it's that big a deal, but it's
annoying not being able to figure this out.

Thanks

Bob Cagle
IT Manager
Lynk, Inc.

--
This is the RPG programming on the IBM i (AS/400 and 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 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.