No. Not true.
EXPORT (which I recommend be placed on all subprocedures) only says "enable this
subprocedure to be called from outside of this module".
However, other scoping rules apply. The next scoping rule is that subprocedures
can not be called from outside of their *PGM.
Service programs allow this, but only if the subprocedure is named/listed on the
EXPORT list in the binder source, or someone foolishly specifies EXPORT(*ALL)
when creating the service program.
-Bob Cozzi
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [
mailto:rpg400-l-bounces@xxxxxxxxxxxx] On
Behalf Of Turnidge, Dave
Sent: Thursday, May 31, 2007 12:11 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: Calling a Procedure from Another Program
Clarification: I thought if you put the EXPORT keyword on a procedure in
a program that it was available from any other program. I think I'm
reading here that that might be true if the program containing the
procedure is bound into the program that would be calling the procedure.
Is this true?
Dave
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[
mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Bob Cozzi
Sent: Thursday, May 31, 2007 12:07 PM
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: Calling a Procedure from Another Program
When Subprocedure live in a *PGM object, they can be called from within
the program object in which they live and no where else.
Subprocedures that live in *SRVPGM objects can be called (assuming
they've been
exported) from other *PGM and *SRVPGM objects.
Your choices are:
1) Move the subprocedure into a service program (would be my choice).
2) Create a module from the subprocedure's implementation and
bind-by-copy to the other programs (poor choice).
--Bob Cozzi
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[
mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Mike
Sent: Thursday, May 31, 2007 11:48 AM
To: RPG programming on the AS400 / iSeries
Subject: Calling a Procedure from Another Program
I am having a brain freeze today. I have a subprocedure in a main
program that I want to call from another program. How do I do this?
--
Mike Wills
http://www.linkedin.com/in/mikewills
Blog -
http://mikewills.name
Podcasts -
http://podcastmike.com
--
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 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.