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



Lim,

I have some linked list code in a service program which does exactly this
already - all packaged up and ready to go. Feel free to contact me off-list
(rory.hewitt@xxxxxxxxx) and I can send it to you if you'd like.

Rory


On 1/15/07, Lim Hock-Chai <Lim.Hock-Chai@xxxxxxxxxxxxxxx> wrote:

Yes, it is intentional.  list.item will be used as a dynamic array.

The basic idea is to allow caller to create multiple item lists.  This
will be a service program and caller will do something like below to use
it:

//Procedure below will lookup empty listmast slot and assign the slot to
poID.
//It will then do listMast(poID) =
%alloc(%size(list.lastElem)+%size(list.item)*100)
createNewItemList(poID);

//Procedure below allow caller to add item to the item list
addItemToList(piID :piItem);

//Procedure below will deallocate a listmast slot
destoryItemList(piID);




-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement

<clip>
>  listMast(1) = %alloc(%size(list.lastElem)+%size(list.item)*100);
>  listMast(2) = %alloc(%size(list.lastElem)+%size(list.item)*100);

Here's you're only allocating memory for 100 items, despite that your
dim() lists 10000.  Is that intentional?

Can I ask what you're doing to accomplish?  You've used an array of
pointers for something that doesn't require pointer logic.  Yet, you've
used a big huge array for something else that probably does require
pointer logic.  What's your goal?

</clip>

--
This is the RPG programming on the AS400 / 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.





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.