G#AddMsg is, I'm guessing, using the QMHSNDPM API. I still use subroutines for the process you describe, but one of the parms for QMHSNDPM (I forget which one) has to do with where on the call stack or such the message is sent. Check the API documentation and modify the G#AddMsg subprocedure accordingly.

Jerry C. Adams
IBM System i Programmer/Analyst
B&W Wholesale
office: 615-995-7024
email: jerry@xxxxxxxxxxxxxxx


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Smith, Mike
Sent: Wednesday, August 27, 2008 8:03 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Subprocedure global/local ?

I am trying to make myself use subprocedures more- rather than
subroutines. I have run into a little problem, and I'm not quite sure
what I need to do.

I have a procedure in a service program that is used for displaying
messages in display files. I use this all the time.

Now I have written a data entry program that has quite a bit of
validation. I have written another service program that has the
validation in it. Because there is a lot of validation I put all of
these within a subprocedure in my main program. Here is where the
problem occurs. My messages don't display. If I simply change the
subprocedure to a subroutine, my messages display.

PGM1
CALLP checkvalid

Pr checkvalid

C Eval PaverErr = valid_paver(cscrew)
C If PaverErr = *On
C Move 'RG1010 ' MSGID
C CallP G#AddMsgSF(MSGID:' ':
C 'RGCMSGF')
C EndIf


G#ADDMSGSF is in service program
Valid_paver is in a separate service program.
Checkvalid is subprocedure in main pgm

Any ideas on how to make this work.

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


This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2019 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].