× 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 1/11/06, Grizzly M <grizzlym@xxxxxxxxxxxxxxxxxxxxx> wrote:
>
> 2) I don't know what's going to be enough elements, but being able to
> change the dimension as needed allows me to answer that question with "I
> don't care how many elements will be needed".
> More than anything else I just want to know how to do it.


Basically, with RPG arrays, you bump your head on the 64k limit.

To create an "array" that is dynamic, with no other limits excepting system
resources, you would have to use a pointer, and the ALLOC() API to allocate
memory to that pointer.  You would have to create a BASED DS, based on a
pointer, that you would walk through the allocated memory, to add new
elements, track the number of elements, and use the qsort() and bsearch()
APIs to simulate a %LOOKUP operation.  You would have to create the program
using STGMDL(*TERASPACE) option, and I believe you could expand your DS
"array" to own the entire system.

I have learned about this technique, and seen examples in the sorcerer's
guide, but I have never written one in production.  Maybe somebody has an
actual example they can share.

--
"Enter any 11-digit prime number to continue..."
"In Hebrew SQL, how do you use right() and left()?..." - Random Thought
"If all you have is a hammer, all your problems begin to look like nails"

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.