Yes, of course I would define multiple procedures, but that complexity
would be hidden to the procedure user.
And as I said, returning a date and manually splitting made the
procedure useless, one might as well use directly the original date
field.
But I'm not lamenting, I'm just kinda *sighing*.
--
Saludos
Antonio Salazar
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Tuesday, January 12, 2010 2:07 PM
To: RPG programming on the IBM i / System i
Subject: Re: RPG overloading (was RPGV?)
...but overloading won't solve that problem. You'll still need one
procedure for every combination.
All that it changes is that those procedures can all have the same name,
instead of having to have a separate name for each one. You still have
to write just as many procedures.
Why don't you just return a date field, and use %subdt() to break it
into it's compontents?
YY = %subdt(splitDate(whatever): *YEARS);
MM = %subdt(splitDate(whatever): *MONTHS);
DD = %subdt(splitDate(whatever): *DAYS);
That's a lot easier than trying to solve this problem using overloading.
Believe me.
Jose Antonio Salazar Montenegro wrote:
Roger, the problem is that our date fields are stored YY, MM DD
components with packed/zoned/integer and binary types. To modify
parameters by reference I'd need one procedure for each combination.
As an Amazon Associate we earn from qualifying purchases.