Why doesn't this work? ('troop' and 'unit' are previously defined Types), it's the '\checked' bit it doesn't seem to like.
;
;
FindTroopLeader(troop)\checked = True
;
;
Function FindTroopLeader.unit(troop.troop)
For this.unit = Each Unit
If this\troop = troop
If this\leader = True
Return this.unit
EndIf
EndIf
Next
End Function
If I use an array it works fine, such as...
claimedNode(x,y)\checked = true
where claimedNode is defined as..
Dim claimedNode.unit(48,48)
;
;
FindTroopLeader(troop)\checked = True
;
;
Function FindTroopLeader.unit(troop.troop)
For this.unit = Each Unit
If this\troop = troop
If this\leader = True
Return this.unit
EndIf
EndIf
Next
End Function
If I use an array it works fine, such as...
claimedNode(x,y)\checked = true
where claimedNode is defined as..
Dim claimedNode.unit(48,48)