Getting pointers from array

Blitz3D Forums/Blitz3D Beginners Area/Getting pointers from array

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.

Thanks all, I can really use those things, especially the comparison with Null, didn't know about that yet.

But as you stated, Floyd, the comparison with Int(...) will also work, as long as the type-instance exists and wasn't created before (checked that with commenting the line "a(4) = New T").

For my game, both ways will work the same (Int and Null), because the type-instances are created when loading data and are only destroyed (or deleted) when the game quits.
The game needs all data in memory (which speeds up loading times between sector-jumps).
When the game is running, no type-instance is deleted (for stations, sectors, asteroids, jumpgates and many more stuff in space (except spaceships I think, I'm not that far yet).

If I get it right, the comparison to Null actually checks if the pointer (that's stored in the array) in valid (points to a existing type-instance) and the Int-comparison just compares the integer-value of that pointer with 0 (and doesn't check if that pointer is a valid one).

Is this correct?

Or is it just that an empty array-index holds the value Null instead of "0" (in case of an array which holds pointers)?