Passing type to function?

Blitz3D Forums/Blitz3D Beginners Area/Passing type to function?

How do I pass and return a type to a function?
In the following code can you let me know the correct syntax where I have put the ??????'s.

Cheers in advance for any help.
Ralphy

Type enemy
Field id
Field xpos#
Field ypos#
Field waypoint_path
Field frame
End Type

Function UpdateEnemy()
For baddies.enemy = Each enemy
FollowWaypoints(baddies.enemy)?????
Next
End Function

Function FollowWaypoints(.enemy)?????
....
return enemy??????
End Function