how to choose which waypoint next?

Blitz3D Forums/Blitz3D Beginners Area/how to choose which waypoint next?

Hey Jfk, thank you :)

i have:

Graphics3D 640, 700, 0, 2

Global Camera=CreateCamera()
SeedRnd MilliSecs() ;


Type lane
	Field id
End Type

Type Child
	Field p.lane
	Field number
	Field x,y,z
	Field myParent
End Type


; fill with data
For i = 1 To 3
	p.lane = New lane
	p\id = i
	For j = 1 To 5
		c.Child = New Child
		c\p = p
		c\x=Rnd(1,7)
		c\y=0
		c\z=i
		c\number=j
		c\myParent=i
	Next
Next

;print current data
t = 0
For p.lane = Each lane
	Print "Lane " + p\id
	For c.Child = Each Child
		If c\p = p 
			Print "waypoint number: "+c\number+" x="+c\x + " y="+ c\y + " z="+c\z
			t = t + 1
		EndIf
	Next
	Print "->has " + t + " children"
t = 0
Print""
Next

;print position 2 in lane 1
Print "****************"
For p.lane = Each lane
	For c.Child = Each Child
		If c\myParent = 1 And  c\number =2 ; I want the data of position # 2 on lane 1
			Print "waypoint number: "+c\number+" x="+c\x + " y="+ c\y + " z="+c\z
		EndIf
	Next
Next


Flip
WaitKey()

End


ButI am getting 3 repeating prints in the second loop, what am i doing wrong? and, is there another way to acess more like:
p.lane = 1
if c.child=2.....


Thanks for looking into this.