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



Something like this?

D MasterList_T...
D DS qualified based(TEMPLATE)
D Customer...
D 6s 0
D Rank...
D 6s 0

D myMasterList...
D DS likeds(MasterList_T)
Based(pMasterList)

D pMasterList S *
D pmasterListArr S * dim(2)


... somewhere in your code

pMasterListArr(1) = %Alloc(%Size(myMasterList) ;
// check for error... if OK, continue
pMasterListArr(2) = %Alloc(%Size(myMasterList) ;
// check for error...


... later

pMasterList = pMasterListArr( idx ) ;






Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"A banker warned the British poet Robert Graves that one could not grow rich
writing poetry. He replied that if there was no money in poetry, there was
certainly no poetry in money, and so it was all even."
-- Robert Graves

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-
bounces@xxxxxxxxxxxx] On Behalf Of Bryce Martin
Sent: Friday, October 08, 2010 11:48 AM
To: RPG programming on the IBM i / System i
Subject: Based data structure as dynamic array

Ok, I know this can be done, and I've looked all morning for an example
but everything I see is related to Dim on the ds and that is NOT what I
want. I know you can base a datastructure on a pointer, and then
allocate
space as needed. I'll be d*mned if I can find a simple example of this.
And no, I don't want to use userspaces. Its unnecessary. I need a
datastructure that has 2 elements. So this will basically be a two
dimensional array, practicallys speaking.

So I'm assuming I would do something like this....

D MasterList_T...
D DS qualified based(TEMPLATE)
D Customer...
D 6s 0
D Rank...
D 6s 0

D myMasterList...
D DS likeds(MasterList_T)

I guess I'm just not sure of exactly how to progress from here.

I've looked at so many examples and counter examples that my mind is
just
kinda going to mush because half the articles I see are from 2002 or
2004
or around that time and the way people used to do it just isn't needed
any
more and new relevant examples don't seem to be as abundant. Once I
get
this working I'm going to be doing a bunch of writeups on what I used
and
why I used them, including my architecture decisions. But I need to
build
it before I write about it. This process is way easier that I've been
finding it to be, and that is the frustrating part.



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.