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



On Mon, Aug 14, 2017 at 6:50 AM, Joni V. <joni_vanderheijden@xxxxxxxxxxx> wrote:
But if there was more than one list in a certain datastructure, we had to resort to mapping the data to the correct position by manipulating their address pointers. This works great, but lowers readability a lot.

This whole approach seemed a bit forced, and I got the feeling that there should be a better approach. How would you have approached this issue?

Are there any plans for dynamic arrays, allowing variables in the Dim keyword like they do for COBOL in OCCURS ... DEPENDING ON?

I'm pretty confident IBM doesn't have any short- or medium-term plans
to add this functionality to RPG. But there has been a decent amount
of open-source activity recently on this front. Something someone has
already built may be suitable for your purposes:

<https://github.com/jerps/RpgMap>
<https://github.com/lppedd/RPG>

You might also want to investigate older but (presumably)
tried-and-tested dynamic array implementations:

<http://rpgnextgen.com/index.php?content=download>
<https://mowyourlawn.com/RPGDynamicArrays.html>

In this day and age, I would not "roll my own" using pointers or
system APIs. I would just use a published library. This would hide
away the harder-to-read code and reduce the chance that I screw it up.
Though, if you're confident in your own code, and can structure it
such that all the tricky stuff happens in a service program, that
should be acceptable. After all, the code has to get tricky and hard
to read *somewhere*, whether you write it or someone else does.

(Actually, what I'd *really* do is use a language other than RPG,
either to eliminate the need for RPG completely, or to at least handle
the interface between the other system and RPG. But I understand this
is not a realistic choice for many if not most people.)

John Y.

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.