How can I go through all entries in a type?

BlitzMax Forums/BlitzMax Beginners Area/How can I go through all entries in a type?

That's pretty much what lists are for.
Type TVector
    Field x,y,z
End Type

Local VectorList:TList = CreateList()
Local a:TVector = New TVEctor

a.x = 10
a.y = 20
a.z = 30

ListAddLast(VectorList,a)

For Local b:TVector = Eachin VectorList
    Print b
Next

You can also use an Array as well, if you need a more random access than lists provide.
Local Array:TVector[10]
For Local i:int = 0 to 9
    Array[i] = New TVector
    Array[i].x = 10
Next

For Local b:TVector = Eachin Array
    Print b
Next