Why does this work?

BlitzMax Forums/BlitzMax Programming/Why does this work?

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.

The debug version has bounds checking built in. The release version does not.

The code Local i:Float[]
creates an array object and assigns it with the 'empty array' (an internal global empty array object - this exists as a static object in memory).

Now, if you read values from this array they are indexed from this empty array's address... anything which follows it in memory may or may not be a valid address for the process. If it is, you get the value at the address - if not you will get an access violation exception.