|
Tom Liotta wrote: > > When you prototype lookup() in the calling procedure, declare a pointer by >value for the second parm. When you call lookup(), pass %addr(terms_code) or >%addr(sh_state). Inside lookup(), you _could_ declare the second parm as >q_alpha_10 10A by reference if you really wish or you can again declare a >pointer and use it as a basing pointer for perhaps q_alpha_10. Just be sure >you never use more than the maximum left-most positions of q_alpha_10 than are >indicated by FORMAT. > The trouble with passing a pointer is that it would be possible to pass the address of a varying length field, which would not work. The compiler doesn't know that the pointer is supposed to point to a fixed-length character field. I would define the output parameter as character options(*varsize). There's still no protection against passing say a char(2) where the format indicates a char(3), but the pointer wouldn't help that case either.
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.