Quick question about Handle()

Blitz3D Forums/Blitz3D Programming/Quick question about Handle()

mrtricks(Posted 2005) [#1]
Say I've got:
Type thing
  Field Stuff
End Type

some.thing = New Thing

Global ind = Handle( some.thing )

... can I be sure that ind will find that object much much later, no matter how many other things have been added or deleted or inserted before or after other things? (as long as it hasn't itself been deleted)

AND... what is Handle, if I want to put it in a Bank? Is it a four-byte word?


RGR(Posted 2005) [#2]
There are no four-byte words... ;-)
4 Byte = Int or Integer --- 2 Byte = Short or Word
Very easy to find out... make a loop from 1 to 100000 around your example above
If you have strange numbers above 65535 it is 2Byte otherwise you can be 99.9999% sure its 4Byte Integers... ;-)
And handles do not change as long they are not deleted.

Edited Was quite shure TypeHandles must be 4 Byte Integers - but had to test it to make it 100% ... they are !


mrtricks(Posted 2005) [#3]
My bad - I thought Ints were also called Long Words. Thanks for the tip.


Hotcakes(Posted 2005) [#4]
They were in olden days...