How to keep track of EachIn loop counter?

BlitzMax Forums/BlitzMax Programming/How to keep track of EachIn loop counter?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

If you need to keep track of the current index of an array then why use EachIn?

Type mytype
	Field fred
End type

Local myarray:mytype[50]

For counter = 0 Until myarray.length
	myarray[counter] = New mytype
	myarray[counter].fred = counter
Next 

For counter = 0 Until myarray.length
	Print counter + " = " + myarray[counter].fred 
Next
Or have I got the wrong end of the stick?