Types within types issues

Blitz3D Forums/Blitz3D Beginners Area/Types within types issues

Thanks for all of the tips!

Surreal had a good idea, but unfortunatly I do not know how large my child datatypes will get.

Foppy also had a great idea, and thanks for explaining types in types for me.

I think that the easiest way to address this would be to use an array for the children:


Type children
Field name$
End Type

Type parents
field childIndex
Field name$
End Type


parent.parents = new parents
dim child.children(255) ;max of 255 parents.

parent\name$="Steve"
parent\childIndex=1
child(parent\childIndex) = new children
child(parent\childIndex)\name$="Steve/julie"
child(parent\childIndex) = new children
child(parent\childIndex)\name$="Steve/justin"

... Don't need to finish, the rest is implied.


I think this is the easiest way to keep the data seperate, and the code simple.

Thanks for the help, and let me know what you think!