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



Hi Alan,

Whoa. Barbara, so this means I can add
> all the parameters I want to my heart's
> content to the already previously existing
> procedures in a service program without
> messing things up at the signature level?
> (In my case I name the signatures myself).

Absolutely. I've been doing this for years. The trick, as Barbara mentioned is to use *NOPASS, and then in the body of your subprocedure, check to see if the caller passed the parm or not. If not, you probably need a default value.

Be careful NOT to use a *NOPASS parameter directly in your subprocedure though, because if the caller didn't pass it, you _might_ have an address in the stack at that position, and you _might_ not get an error message, but you'd be inspecting and perhaps changing memory that you shouldn't!

*=========================================
* create user space
p crtUsrSpc b export
d crtUsrSpc pi n
d i_spcNam 10 const
d i_spcLib 10 const
d o_error like(api_err)
d i_text 50 const options(*nopass)
d i_atr 10 const options(*nopass)
d i_siz 10i 0 const options(*nopass)
d i_aut 10 const options(*nopass)
d i_rpl 10 const options(*nopass)

d w_text s like(i_text)
d w_atr s like(i_atr)
d w_siz s like(i_siz)
d w_aut s like(i_aut)
d w_rpl s like(i_rpl)

// load working variables from input
if %parms < 4;
w_text = *blanks;
else;
w_text = i_text;
endif;

...

Also, one still needs to create a new signature
> for the new program(s) that actually use the new
> parameter, don't they?

Not following this. The signature belongs to the service program. I have signatures like this

strpgmexp pgmlvl(*current) signature('01.00 20070404')

and when I make a change, I keep signature('01.00 20070404') as *PRV and increment the version number. Existing programs have '01.00 20070404' as their signature comparison, and so run just fine. Newly changed program that use the new functionality in the *NOPASS parameter will get the new signature to compare against. It's probably unnecessary, but it's easy for me to see what program is consuming what version of the service program.
--buck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.