Hey all
is it poss to have a List as a field in a type? the list would be of another type e.g:
type units
field uType:string
end type
type player
field unit:tList = CreateList()
end type
u:units = new units
u.uType = "hello"
p:player = new player
listaddlast p.unit, u
would work ok. but if i try to go thru the objects with:
For a = EachIn p.units
Print p.units.uType
Next
would give me an error 'foreach index variable must be an object'
but i thought it was :)
cheers
is it poss to have a List as a field in a type? the list would be of another type e.g:
type units
field uType:string
end type
type player
field unit:tList = CreateList()
end type
u:units = new units
u.uType = "hello"
p:player = new player
listaddlast p.unit, u
would work ok. but if i try to go thru the objects with:
For a = EachIn p.units
Print p.units.uType
Next
would give me an error 'foreach index variable must be an object'
but i thought it was :)
cheers