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



>No.  Adding a parameter does not change the signature.
I agree.

So let's say that I have a program called HORSE.  Last week when I compiled
it, it had this line of code in it:

C       callp   beat_horse(%addr(horse):'Z')

and here was the prototype used:
     P beat_horse      B                   EXPORT
     D beat_horse      PI
     D   horse_ptr                     *   value
     D   stick_type                   1A   const

Then my manager came by and said that the rider wanted to beat the horse
more than once so I had to change the subprocedure to be like so:

     P beat_horse      B                   EXPORT
     D beat_horse      PI
     D   horse_ptr                     *   value
     D   stick_type                   1A   const
     D   num_times                   10I 0 value

I agree that this would not cause a signature violation, but your program
will puke because you changed the parameter list.  Jon Paris has already
summed it up well in another post he sent while I was writing this:

<Jon Paris quote>
You could, for example, add an additional parameter to the list for a
subproc.  If you add the parm at the end of the list and make it optional
then have the subproc test for it, the existing code will work just fine.  I
agree that in many cases though a change in parms will require not
simply a recompile but also a change in the logic of the calling program.
</quote>

I think the confusion was in I was not utilizing *nopass in my examples and
you guys were.  Are we on the same horse, I mean page, now?

Nothing like a little heated debate to send us into a weekend huh;-)  I feel
like I could ride the Tri-Moto for a week and not get tired:-)

Aaron Bartell

-----Original Message-----
From: Scott Klement [mailto:klemscot@klements.com]
Sent: Friday, May 03, 2002 4:20 PM
To: 'rpg400-l@midrange.com'
Subject: RE: Grrr... signature violation




On Fri, 3 May 2002, Bartell, Aaron L. (TC) wrote:
>
> <snip>
> No.  Changing the parameters will not change the signature, unless you
> also change the name of the procedure, or change the order, etc.
> </snip>
>
> That's what I said in more words or less.  If you change the parameters,
so
> let's say I added one onto the end of a sub procedure, you indirectly
change
> the signature because you will now have to create a new version in the
> binder language or recompile all of the programs that were previously
> compiled to the old parameter list to now look at the new parm list.  Or
am
> I still off.  I can't see a difference in what I said compared to what you
> said, Scott.

The reason that I don't think you're saying the same thing is that you
say things like this:
     "If you change the parameters, so let's say that I added one onto
      the end of a sub procedure, you indirectly change the signature..."

No.  Adding a parameter does not change the signature.   You don't have
to change the binding language, because parameters aren't in the binding
language.   You don't have to recompile anything but the service program.

If you have this procedure:

     P beat_horse      B                   EXPORT
     D beat_horse      PI
     D   horse_ptr                     *   value
     D   stick_type                   1A   const

And you add a parameter to it:

     P beat_horse      B                   EXPORT
     D beat_horse      PI
     D   horse_ptr                     *   value
     D   stick_type                   1A   const
     D   num_times                   10I 0 value options(*nopass)

This does NOT affect the signature.  You only have to recompile the
service program.   The other programs work fine.  There's nothing
to change in the binding language, because binding language doesn't
deal with paramters -- it deals with EXPORTS.

However, you seem to be saying that you're doing THIS instead:

     P beat_horse      B                   EXPORT
     D beat_horse      PI
     D   horse_ptr                     *   value
     D   stick_type                   1A   const

     P beat_horse2     B                   EXPORT
     D beat_horse2     PI
     D   horse_ptr                     *   value
     D   stick_type                   1A   const
     D   num_times                   10I 0 value

This *WOULD* change the signature, because you're adding a new export
called "beat_horse2".   Which would then have to be added to the binding
source.

Sorry for the procedure names :)


_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
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 ...


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.