Object() command?

Blitz3D Forums/Blitz3D Programming/Object() command?

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.


You can now use Handle to get the memory address for that type instance.


Sorry to be a pedant but that's not quite true. Handle doesn't return a pointer (memory address), it simply returns a number which are issued sequentially. i.e. the first time you call handle it'll return 1, the next time you call it (on a different type instance) it'll return 2, etc. I quess it's a bit like checking your coat in in a cloakroom where the attendant gives you a number so you can retieve it later.

Because the same number is never issued again for the duration of the program (even if you delete the type instance), it would be possible to write some shoddy code that would cause handle to eventually run out of numbers to issue. Granted, this would have to be some very shoddy code (creating and deleting large amounts of types, frequently), and it would have to be running for some time. Never the less, the possibility still remain and this (I'm guessing) is the reason why Handle/Object are not officially supported.

Bah, rambled a bit there. :P

Anyway, I seem to remember there was some more detailed info on the Handle/object over at Blitzcoder.