|
>> parm 'partousr' is a 10 long character field. i would like the option of >> NOT having to pass it, but if i do pass it i don't want it changed. can >> someone explain to me why this doesn't compile? CONST is a promise that the parameter is treated as read-only. The compiler will therefore protect any parameters described as such by refusing to allow you to change them. When you coded " if %addr(partousr) <> *null" I suspect that the compiler overreacted to the %Addr. It doesn't want you to have the address since you could then break your promise. If this is indeed the answer it is being way too strict. There were a few problems in this area in the V3R2 release - are you up-to-date with PTFs ? If you are ure up-to-date, then you should probably APAR this, but in the meantime, two ways to deal with it. a) Use VALUE instead of CONST. This is OK as long as you are calling a procedure and not a program. b) Set up all of your default values and use those fields in subsequent processing. If one of the *NOPASS parameters is supplied, simply move it to the field that holds the default. This of course only works if you don't use *OMIT. PS. Do you really need to use both *NOPASS and *OMIT - it looks like overkill. Also if you are not using the parameter descriptions (and I see no sign that you are) then don't code the OpDesc keyword. It only slows things down. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This is the RPG/400 Discussion Mailing List! To submit a new * * message, send your mail to "RPG400-L@midrange.com". To unsubscribe * * from this list send email to MAJORDOMO@midrange.com and specify * * 'unsubscribe RPG400-L' in the body of your message. Questions should * * be directed to the list owner / operator: david@midrange.com * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
As an Amazon Associate we earn from qualifying purchases.
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.