Types problem

Blitz3D Forums/Blitz3D Beginners Area/Types problem

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.

Hi, having a little problem with types here. I'm getting an "Illegal Type Conversion Error" when i am trying to return a type from a function.

Type car
	Field x
End Type

c.car = New car
c\x = 10
c.car = New car
c\x = 60
c.car = New car
c\x = 50
c.car = New car
c\x = 40
c.car = New car
c\x = 30
c.car = New car
c\x = 20

c.car = findcar()
Print c\x




Function findcar()

	For t.car = Each car
		If t\x = 10 Then
			Return t.car
		End If
	Next

End Function


I know i could use the Handle and Object method, but i thought that would work above... Am i doing anything wrong? Thanks for any help you can give :o)