Hi,
try this code:
try this code:
Strict Framework brl.blitz Local Text$ = "Text" WriteStdout Text [ -5 ] + "~n" 'Danger of undefined results! WriteStdout Text [ -4 ] + "~n" 'Danger of undefined results! WriteStdout Text [ -3 ] + "~n" 'Danger of undefined results! WriteStdout Text [ -2 ] + "~n" 'Danger of undefined results! WriteStdout Text [ -1 ] + "~n" 'Danger of undefined results! WriteStdout Text [ 0 ] + "~n" 'Ok, returns: 84 -> T WriteStdout Text [ 1 ] + "~n" 'Ok, returns: 101 -> e WriteStdout Text [ 2 ] + "~n" 'Ok, returns: 120 -> x WriteStdout Text [ 3 ] + "~n" 'Ok, returns: 116 -> t WriteStdout Text [ 4 ] + "~n" 'Danger of undefined results! WriteStdout Text [ 5 ] + "~n" 'Danger of undefined results! WriteStdout Text [ 6 ] + "~n" 'Danger of undefined results! WriteStdout Text [ 7 ] + "~n" 'Danger of undefined results! WriteStdout Text [ 8 ] + "~n" 'Danger of undefined results!Currently it seems to be possible in BlitzMax to access any memory location just by indexing a string. There's no boundary check (like with arrays). I don't like this, since this could be the source of some wired and hardly findable bugs. It is just a lack of security when programming. Could you please add a some code which checks whether the index is smaller than zero or greather or equal to the string size, and then throws an "Index out of bounds!" exception?