Hi Tim,


"I am thinking that I would pass a pointer rather then the value, but
not sure how I would code this."

For the record, in your example code you are passing a pointer and not
the value. You'd only be passing value if you specified VALUE on the
parameter(s).

As was said, you could format the numeric field to fit the parameter
definition.

Another option is to create another procedure called WriteDiffNum (if
you did this, I suggest changing WriteDiff to WriteDiffAlpha). Then you
could format the numeric value as you want it (so the caller doesn't
need to know how) then do what you need to with it. (examples below)

Personally, since RPG doesn't have overloading (I wish it did), I'm a
fan of separate procedures that have explicit meaning. Formatting a
field so it can be passed as a parameter is just an additional step that
you're forcing upon the programs that call the procedure in question -
and what if someone uses an incorrect formatting?


P WriteDiffAlpha b
D pi
d fieldchange 10a const
d value 80a const

/free
WriteDiff( fieldChange: value );
/end-free
P WriteDiffNum e


P WriteDiffNum b
D pi
d fieldchange 10a const
d value 35p 5 const // (or whatever size)

/free
WriteDiff( fieldChange: %editC( value: '1' ) );
/end-free
P WriteDiffNum e



Kurt Anderson
Application Developer
Highsmith Inc

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 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].