If the parameter is a *optional parameter, you have to use %parms() to
check if the parameter is passed by the caller.
If the parameter is a *omit parameter, you have to use %addr() to check
if the parameter is passed by the caller.
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Arthur.Marino@xxxxxxxxxxxxxxxx
Sent: Thursday, March 20, 2008 1:00 PM
To: RPG programming on the AS400 / iSeries
Subject: RPG-ILE Service Pgm and Parameter Passing
I'm testing the proc in a service pgm that defines 3 parms, all of which
are 10 bytes, alpha and "const". The last 2 have "options(*nopass)".
I'm testing for the presence/absence of the last 2 parms using
%addr(parm) equal/not equal to *null.
I have the main pgm call the proc twice, once with all 3 parms present
(x = proc(p1:p2:p3)), the second time with only the 1st parm present (x
= proc(p1)). In debug, the 2nd invocation of the service pgm proc shows
the 2nd and 3rd parms containing the data from the 1st invocation. Since
I didn't pass those parms in the 2nd invocation, shouldn't they be
undefined??? If not, how does one have the proc function differently
based on the number of parms passed? Do I have to check the %parms BIF?
If that's the case, what exactly is %addr(parm) good for?
Arthur J. Marino
Southern Container Corporation
(631) 297 - 2276
--
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.