× 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.



"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx> wrote on 08/17/2016 12:38:26
PM:
However, what I'm after is to make a polymorph functioncall like:

print(123.45);
print('hello world');

And let the "print" take care of which type is actually used. The
ILE has a "descriptor" so you can taste what kind of type, but RPG
don't let you define a weak prototype.

RPG, itself, supports a polymorphic call, as you termed it. The
%date() built-in function is an example. The question is, can we create a
procedure which can do the same thing. I have wanted to do that, too. The
way I do it now is a kludge where I accept a character parameter and then
test it for numerics. The problem with this is when I want to pass
character data that happens to be numeric. In this case I have to prefix
the data with a blank in order to make the parameter non-numeric and the
procedure then has to drop the blank. Like I said -- a kludge.

Sincerely,

Dave Clark

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.