for each

BlitzMax Forums/BlitzMax Programming/for each

{cYan|de}(Posted 2004) [#1]
er Q where did "Each" go? trying to loop thru a set of types here, all is not well :P


fredborg(Posted 2004) [#2]
You need to add them to a TList and use For bla = EachIn list


{cYan|de}(Posted 2004) [#3]
reusing this post, tnx¬


fredborg(Posted 2004) [#4]
' A hello type
Type hello
	Field x
End type

' Make a tlist to hold all hellos
list:tlist = New tlist

' Make 6 hellos and add them to the list
For i = 0 To 5
	h:hello = New hello
	h.x = Rand(0,1000)
	List.AddLast h
next

' Go through the list and print to the output window
For h:hello = EachIn list
	Print h.x
next



{cYan|de}(Posted 2004) [#5]
lol what a muppet, i just forgot to call updatemapsystem()

nm tnx:)