Morning all,

 

I need to code a structure that looks like this:

 

Q1 --- X1 --- F1

              --- F2

              --- F3

     --- X2 ---- F1

 

Q2 -- X2 --- F1

 

i.e. For every Q (highest level), there can be multiple X's. For every X, there can be multiple F's (lowest level). I want to create this structure and then be able to traverse it. E.g. Q1, X1, F1, then Q1, X1, F2, etc. right through the whole structure. Each Q, X, and F, are purely a string.

 

I thought about using a multidimensional dynamic array and using Delphi help could probably get this working. However, I'm new to Windows programming (1+ yrs) and want to learn OO. I've written a couple of objects recently, so thought I might try to tackle this as a Q object which has multiple X objects inside it, and then multiple F objects inside the X objects.

 

I've started reading about collections and trying some sample code, but don't know enough to "create a collection within a collection", or even if that's a correct concept.

 

Any comments or suggestions? Would a TObjectList be better? Should I just stick to an array?

 

TIA

Dave Jollie
Developer, TOWER NZ IT

(: 09 368 4259
Ê: 09 306 6801
*: [EMAIL PROTECTED]
.: 46 Parnell Rd, Parnell, Auckland

 

Reply via email to