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



1st version: MyProc   pr  extproc('MyProc.01.00')
2nd version: MyProc   pr  extproc('MyProc.01.01')
3rd version: MyProc   pr  extproc('MyProc.02.00')

Frankly, the need to do something like this only comes up VERY VERY rarely. The ability to add optional parameters to the end of the prototype without affecting anything makes it easy to update service programs without having to maintain a dozen versions of a given subprocedure. That eliminates headaches, nightmares, blurred vision, stomach cramps...

... ANYWAY...

When you DO have an occasion where you must add a new procedure interface in order to preserve backward compatibility, it's easy to do with binder source.

Let's say that this is your original service program layout:

STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('MySrvPgm Signature')
    EXPORT SYMBOL('MyProc')
ENDPGMEXP

Remember, when programs are bound, they do so by "export number". In this case, there's only one export, and it's export #1. So that's what any calling program remembers about it -- it remembers it being called "Export #1" It doesn't even really know that the name was MyProc.

Now, horror of horrors, you're forced to introduce a new procedure interface that would break backward compatibility. Here's what you do:

a) Go into the source code for the service program, and change the
   name of MyProc to be MyProc_v1.  Change the code for MyProc_v1
   so that it manipulates the parameters and calls the new version
   which will now be called MyProc.

b) Update the binder source to read as follows:

STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('MySrvPgm Signature')
    EXPORT SYMBOL('MyProc_v1')
    EXPORT SYMBOL('MyProc')
ENDPGMEXP

Now programs that are still using the old signature are calling Export #1, which has changed to now be called MyProc_v1. New programs, since they'll be looking for MyProc() will get signature #1 which is the current version of the procedure.

The main thing that I want to stress is that it's EXTREMELY unusual that you have to do something like this. It's much better to have a simpler, easier to use naming convention, and deal with the exceptions when they come up than to great a hugely complicated naming convention to protect you against something that will only come up, maybe once a year.

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.