|
Ok, I realize this topic is messy...but I really thought I'd hear from someone <grin> I got the hard coded stuff working and was looking at what needed to be done for my SndErrMsg() wrapper procedure of the QMHSNDPM API to determine dynamically where to send the message. I know I can retrieve the call stack. That's step one. Ideally, I'd like to find the first prior program with an open display file. Is there anyway to do this? One of the messages in the archive mentioned the open source iSeries Toolkit project. There's some messaging functionality included and I download it and took a look at it. The author, David Morris, had an interesting brainstorm regarding how to handle the difficulties of know where to send a message. A quote from the documentation explains it: "While struggling to come up with an easy way to determine where application messages should be sent, I had a revelation: Why not just use a single queue for all messages? Using a single queue (a program queue for OPM; a call queue for ILE) for all user interactions in interactive jobs has several advantages." I like it, but the problem I have is that his solution requires the users initial program to set the default program queue to use. I don't know that will be completely acceptable or not. But David's idea lead to one of my own. Why not simply use the program queue from some program that is "always" in the call stack. A quick examination turned up a likely candidate, QCMD. A few changes to the source and some testing later...seems to work beautifully. Does anyone see where this would cause a problem? One thing I thought about is the possibility of having multiple QCMDs in the call stack. But a quick test didn't seem to show any problems. In additional, let me say thanks to David for the idea of sending two messages, one to the caller so you know who called the SndErrMsg() and one to the "Default" queue for the error message subfile to pick up. Again, anybody see any problems with this? Even with what appears to be a "working" solution, I'd be interesting in knowing if there is some way to pick out the first prior program/module in the call stack with an open workstation file. Thanks, Charles Wilt -- iSeries Systems Administrator / Developer Mitsubishi Electric Automotive America ph: 513-573-4343 fax: 513-398-1121 > -----Original Message----- > From: rpg400-l-bounces+cwilt=meaa.mea.com@xxxxxxxxxxxx > [mailto:rpg400-l-bounces+cwilt=meaa.mea.com@xxxxxxxxxxxx]On Behalf Of > Wilt, Charles > Sent: Monday, July 18, 2005 11:05 AM > To: RPG Programming Mailing List (E-mail) > Subject: Error message subfiles and procedures > > > All, > > I've been through the archives, looks like I'm not the only > one who has run into this wall. > > However, the information in the archives hasn't been of much > help. I understand what the problem is, but I'm still trying > to figure out how to solve it. > > I've got a BNDRPG "work With" program with multiple sub procedures. > > It calls routines in a service program to perform file I/O. > I'd like the procedures in the service program to be able to > add entries to the program message queue so the can be > displayed via the error message subfile in the "Work with" screen. > > I've wrapped the QMHSNDPM API in a SndErrMsg() procedure in > another service program. > > Since the I/O service program doesn't know where it could be > call from, ideally the SndErrMsg() program needs to determine > where the message should be sent. > > However, so far, I've been unable to get even a hard coded > test case working. > > Some areas I'm wondering about: > 1) Behavior difference between DDS SFLPGMQ(10) and > SFLPGMQ(267) when program is ILE? > 2) Behavior difference between '*' and the *PROC name from > program status DS when loaded to SFLPGMQ field. > 3) Does it matter where (mainline or sub-procedure) the error > message subfile control record is written or when the SFLPGMQ > field is loaded. > 4) What the heck do *PGMBDY, *PGMNAME, and *CTLBDY mean in English? > > > Does anybody have any tips/tricks/info that would help? > > Thanks, > > > Charles Wilt > -- > iSeries Systems Administrator / Developer > Mitsubishi Electric Automotive America > ph: 513-573-4343 > fax: 513-398-1121 > > > -- > 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-2025 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.