|
Hi Mark,
Yes i know.
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.
Thank you for your concens
Niles
Sendt fra min iPad
Den Aug 17, 2016 kl. 14:29 skrev Mark Murphy/STAR BASE Consulting Inc.<mmurphy@xxxxxxxxxxxxxxx>:
type. In RPG every pointer is a "void" pointer. So then
So you are talking about void pointers then, or a pointer that takes no
rpg400-l@xxxxxxxxxxxx>
void * myfunc(void *)
is equivalent to
dcl-pr myfunc Pointer;
field1 Pointer value;
end-pr;
Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx
-----Niels Liisberg <NLI@xxxxxxxxxxxxxxxxx> wrote: -----
To: "RPG programming on the IBM i (AS/400 and iSeries)" <
From: Niels Liisberg <NLI@xxxxxxxxxxxxxxxxx>these info in the invocation stack ( if DECLSPEC is provided) however RPG i
Date: 08/16/2016 06:55PM
Subject: Re: Where to post ideas for RPG
Hi Mark.
Actually all of the above.
Both returning and defining parsed parameters.
Maybe you know that it is quite easy from within C to use and query
rather rigid regaring types in prototypes.
pointer to value and let the caller do the rest of the job.
So basically what I am after is to let RPG just parse the value / or
maching procedureinterface) but RPG will drive it far with little effort,
In C++ it is called polymorphism ( with a twist since it would call a
not implementiong full polymorphism, but rather let the caller deal with
the parameters....
early gues could be:
So
dcl-pr myfunc void; // The return value has to be examined from the stack
fld1 void value; // Put the value on the stack ( what ever that is)
fld2 void; // Put the address to fld2 on the stack
end-pr;
I don't have a nice syntax for the dynamic numbers of parameters but a
also bring in bad coding practis. But also be efficient for conversiontools
dcl-pr myfunc;
fld1 int(10) value; // First normal strong prototype ( if any)
*ANY; // Now any numbers of parameters of any types
end-pr;
The above aproch can also be used for lasy procedure declarations, and
to bring in old RPGlll code into to the ILE game.
<mmurphy@xxxxxxxxxxxxxxx>:
Den Aug 16, 2016 kl. 15:19 skrev Mark Murphy/STAR BASE Consulting Inc.
rpg400-l@xxxxxxxxxxxx>
What do you mean by a void prototype?
void myfunction(int)
dcl-pr myfunction;
fld Int(10) value;
end-pr;
or
int myfunction(void)
dcl-pr myfunction Int(10);
end-pr;
Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx
-----Niels Liisberg <NLI@xxxxxxxxxxxxxxxxx> wrote: -----
To: "RPG programming on the IBM i (AS/400 and iSeries)" <
Which is "any number of parameters" just like in C so I could have a moreFrom: Niels Liisberg <NLI@xxxxxxxxxxxxxxxxx>
Date: 08/15/2016 06:58PM
Subject: Where to post ideas for RPG
Hi,
It wold be great if RPG had some kind of "void" prototype and "..."
clean integration to i.e. The C function "printf()" .
give variable.
Also a %TYPEOF() that returs a given type / lenght datastructure of a
directly. So what to do? Send mails to Barbara Morris? Is there a forum
Now. I'm not a member of CEAC. I don't have a place to post these ideas
elsewhere?
(RPG400-L) mailing list
Regads
Niels Liisberg
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
questions.To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
(RPG400-L) mailing list--
This is the RPG programming on the IBM i (AS/400 and iSeries)
questions.To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
--mailing list
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
To post a message email: RPG400-L@xxxxxxxxxxxxquestions.
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
--mailing list
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
To post a message email: RPG400-L@xxxxxxxxxxxxquestions.
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
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.