Your illegal conversion error...
Just use in your example above Return Handle(b)
and recall it with
Has the advantages: Code is easier to read and you can put FindBuilding in your decls file to have the Function highlighted what is afaik not possible if you use for example
Btw: There's a thread: only 1 day old http://www.blitzbasic.com/Community/posts.php?topic=45753 where you could have read more about it...
Inclusive a working example
Just use in your example above Return Handle(b)
Function FindBuilding(id) For b.building = Each building If b\id = id Then Return Handle(b) Next End Function
and recall it with
house.building=Object.building(TheReturnedValue)
Has the advantages: Code is easier to read and you can put FindBuilding in your decls file to have the Function highlighted what is afaik not possible if you use for example
Function CreateBuilding.building(id) ... ... End Function
Btw: There's a thread: only 1 day old http://www.blitzbasic.com/Community/posts.php?topic=45753 where you could have read more about it...
Inclusive a working example