|
|
![]() |
|
|
|
|
||
|
Adding Subprocedures to a Service Program, Revisited Hey, Ted: Regarding your article, "Adding Subprocedures to a Service Program," there's a question I've always wondered about. Why is the *CURRENT/*PRV way of handling new exports, such as this example:
STRPGMEXP PGMLVL(*CURRENT)
EXPORT SYMBOL('ONEMORETHAN')
EXPORT SYMBOL('TWICE')
EXPORT SYMBOL('ONETHIRDOF')
ENDPGMEXP
STRPGMEXP PGMLVL(*PRV)
EXPORT SYMBOL('ONEMORETHAN')
EXPORT SYMBOL('TWICE')
ENDPGMEXP
STRPGMEXP PGMLVL(*PRV)
EXPORT SYMBOL('ONEMORETHAN')
ENDPGMEXP
so popular compared to the hard-coded signature method, where you only keep one export list, as shown in this example:
STRPGMEXP PGMLVL(*CURRENT) SIGNATURE("MATH")
EXPORT SYMBOL('ONEMORETHAN')
EXPORT SYMBOL('TWICE')
EXPORT SYMBOL('ONETHIRDOF')
ENDPGMEXP
You have to keep the exports in the same order and add news ones at the end anyway, so I don't see the advantage of using *PRV signatures.
-- Barbara Morris I'm not sure why the SIGNATURE(*GEN) method is so popular, but I'll take a guess: That's the way the writers for the tech magazines learned it first. Whatever the reason, the hard-coded signature method makes sense and does seem easier. If other readers know of a down side to hard-coded signatures, or otherwise have feelings about this issue, I hope they will e-mail me . I tested the hard-coded signature with the example in the original tip, and it worked fine. I was able to add more exports to the service program without getting signature level checks. -- Ted
|
Editors
Contact the Editors |
|
Last Updated: 9/11/02 Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved. |