× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thanks all. Just messing around with "new" stuff. :)

The more I think about it I am not sure this is the best way to overload...
if I already know which DS I have to set up for the data returned, I would
know I can also call the specific proc for that DS.

I'm gonna ponder it.

Thomas, if that was to me sorry. A couple things.

1. I don't live near Eagan I'm more southern MN south of Mankato
2. I haven't done C++ since college. :)

If you ever are in Mankato (or anyone is) feel free to email me and we can
meet out for beers or something. :) I get into town a couple times a week
most weeks.

On Sun, Jan 14, 2024 at 5:00 PM Daniel Gross <daniel@xxxxxxxx> wrote:

Hi Brad,

I have some procedures which have multiple parameters where only one of
them differs in type.

As an example I coded some logging procedures which are accepting a "name"
and a value. The name is always a varchar, but the value can be some char,
varchar, decimal, ... - then overloaded it.

Just some weeks ago I replaced the overloaded procedures with just one
with *convert - but until then it worked flawless.

You have to be careful - as the compiler selects the right procedure - it
will go through the list from left to right, trying to find a procedure
that matches the actual parameters - this can be tricky with const/value
and char/varchar - so you have to plan the overloading.

HTH
Daniel


On 1/14/2024 2:11 PM, Brad Stone wrote:
So, I decided to start digging into this. It looks pretty cool. Thanks
for
the examples online (Scott!)

I have yet to find any examples with more than one parameter, so here is
my
question....

Can you overload with multiple parameters where one or two are different?
Like this to retrieve an invoice or PO:

dcl-pr getInvoice int(10);
In_ID char(128) const;
Out_Invoice likeds(invoiceDS) options(*exact);
end-pr;

dcl-pr getPO int(10);
In_ID char(128) const;
Out_PO likeds(poDS) options(*exact);
end-pr;

dcl-pr getData int(10) Overload(getInvoice:getPO);

So you could do something like:

dcl-ds thisInvoiceDS like(invoiceDS) end-ds;
dcl-ds thisPODS like(poDS) end-ds;
dcl-s rc int(10);

rc = getData('10':thisInvoiceDS);
rc = getData('10':thisPurchaseOrderDS);

From what I'm reading this should work.

Blizzards are fun. Downtime = exploring time. :)

Bradley V. Stone
www.bvstools.com
Native IBM i e-Mail solutions for Microsoft Office 365, Gmail, or any
Cloud
Provider!
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

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.