Question about Types (B3D)

Blitz3D Forums/Blitz3D Programming/Question about Types (B3D)

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.

I had a brainwave about how to optimize my code, but then it fell flat. I had been doing the following:
house.building = New building
house\id = nextid: nextid = nextid+1
space.room = New room
space\buildingID = house\id

... in order to cross reference rooms with the building they belong to. But then every time I wanted to know which building a room belonged to, I had to do this:
space.room = First room
house.building = First building
While house\id <> space\buildingID
house = After house
Wend

... in order to iterate through the buildings until I found the right one. Then I read more about types and the type identifier and I *thought* I could do this:
house.building = New building
space.room = New room
space\buildingID = house

But I get an "Illegal Type Conversion" error. I think it's a shame I can't store the type identifier as a variable, for future use. Is this something that is legal in BlitzMax? Even better, is it possible in B3D?