Functions as Types?

Blitz3D Forums/Blitz3D Beginners Area/Functions as Types?

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.

2 things.

1)
I would change the function call with:
temp = FindTroopLeader(troop)
temp\checked = true
where temp is declared as temp.troop

2)
I would distinguish between type structure name and type pointer name; in your example, troop is the type structure name, and also the type pointer name, which I find a bit confusing.
So, make your type structure always with t_ suffix, for example:
type t_troop
field...
end type
global troop.t_troop

Hope this helps,
Sergio.