listof structure within structrure

simon

New member
Joined
Sep 25, 2006
Messages
2
Programming Experience
Beginner
Hi

I'm relatively new to vb.net. I'd like to know if you can have a listof structure B within structure B, I've a feeling the answer is going to be no and that it's wise to do this in classes

e.g.

Public Structure structureB
Public var1 as string
Public var2 as string
end structure


Public Structure structureA
Public oList1 as Listof(structureB)
end structure

The problem is that there would seem to be no way of instantiating the instance of olist1

Regards
 
Structures are supposed to be simple types. Your structureA looks like a candidate for being a class to me. Instance fields can be initialised where they're declared in classes so that issue disappears too.
 
Back
Top