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




that is true.  If I had v5r3 on my system I would make great use of
sub field data structs.

I use them a lot, and I'm at V5R2. I think you can do most of it at V5R1.

the rpg way of:
  PrintAddressLabel( vendor.RemitAddr ) ;
is too verbose.

The way that you call Java classes (which are OO) from RPG is to always pass the object as the first parameter...


Seems logical that you'd do it the same way in RPG as well....

PrintAddressLabel(vendor);

If there were additinal parameters, they'd come afterwards:

PrintAddressLabel(vendor: 'PRT01');

That's all do-able in RPG right now. It's not an OO language, so don't be surprised that it's syntax isn't perfect for OO things, but you can do pretty much everything. (Which is almost exactly what Joe said...)


after someone from IBM posted the QleActPgmBnd and the QleGetExp api
examples last week I was trying to work out how to implement virtual
functions and interfaces in RPG and ILE.

Those APIs have been discussed several times in the past, they aren't new. The "Long" versions of them are new to V5R3, but the original versions have been around for awhile.



It was an interesting exercise. If you over allocate the space for your struct and place a pointer to a vtable in the extra space you can start to implement some virtual class features. But using just RPG it gets messy very quickly!

Yeah, I've done that, too... in fact, in HTTPAPI I do something like that (not quite the same) for my communications drivers. You call a routine in the driver to create the data structure, and it allocates the memory -- so it can allocate extra space and tack on some data of it's own if it wants to.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.