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



Yike!!!. Not so good way of doing think (me think).

Below is how it works (I think):
1) Every RPG module, by default, contains a main procedure (the main
body of the RPG module). The name of this main procedure, is the same
as the name of the module.

2) If you do a DSPPMG on the program in question (The caller, the one
with the prototype specified), you should see that the "program" module
(the call program, the one being prototyped) is being bound to this
program.

3) So, the callp is basically calling the main procedure of the
"program" module.


Since main procedure can not return a value, prototype with a return
value of n is a bit misleading.


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Emily Smith
Sent: Friday, April 25, 2008 10:58 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Prototyped call question?

This isn't exactly a problem, as the program is working perfectly fine.
I guess I just don't understand
*how* it's working.

In the program I'm looking at there is a prototype defined as follows:

Dprogram pr n
D 10a
D 2a
D 1a
D

Then later in the program...

c callp program(field1:field2:field3)

I've searched the source and there is no other reference in the source
for 'Program'. There are also no copy directives. When the callp is
executed, an external program is called. How is this possible when their
is no extpgm keyword in the prototype? Also, what is the significance of
the 'N' indicator datatype in the prototype definition?




Emily Smith
Programmer/Analyst
Bank Data Services
(618)659-4550


CONFIDENTIALITY NOTICE: This email message is private, confidential
property of the sender, and the materials may be privileged
communications intended solely for the receipt, use, benefit, and
information of the intended recipient indicated above. If you are not
the intended recipient, you are hereby notified that any review,
disclosure,distribution, copying or taking of any other action in
reference to the contents of this message is strictly prohibited, and
may result in legal liability on your part. If you have received this
message in error, please notify the sender immediately and delete this
message from your system. We believe that this email and any attachments
are free of any virus or other defect that might affect any computer
system that it is received and opened in, however, it is the
responsibility of the recipient to ensure that it is virus free and the
sender accepts no responsibility for any loss or damage.
--
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 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.