|
I'm writing a procedure that's a nicer interface to cvthc. cvthc's parameters are two pointers and an integer. In the fields of my procedure's prototype, I don't want to specify some arbitrary field length limit. I basically want to pass two pointers and an integer indicating the length of one of the fields. I originally coded it exactly like that, but the caller has to specify %addr(source), etc. I'd like to avoid that. I'm looking at changing the source and destination fields to be options(*varsize), but there is a strange detail. The V5R2 RPG manual says "When OPTIONS(*VARSIZE) is specified, the passed parameter may be shorter or longer in length than is defined in the prototype." So it's up to me to pass sane fields and a sane length, etc. I'm prepared to do that. The question is, on options(*varsize) fields, what do I specify as the length? The procedure knows to expect data "longer or shorter" (I suppose they also mean equal) than whatever I specify for the length. If so, why do I have to specify a length at all? I'm thinking about just saying the field is 1a options(*varsize). I think that'll be like passing a pointer, except the caller doesn't have to do %addr. Thanks. brian.
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.