@BRL - request: String indexing boundary checks

BlitzMax Forums/BlitzMax Programming/@BRL - request: String indexing boundary checks

Erm the -4 and -8 access is not only important to the C code but to many BM programmers as well.

As mentioned above: if you want to have your boundary safe access use functions. Here is the code if you want it :)

function WriteByteToString(str:String, val:Byte, index:int)
   if index < 0 or index >= str.length Throw "Access out of boundary on string " + str
   str[index] = val
end function


function ReadByteFromString:Byte(str:String, index:int)
   if index < 0 or index >= str.length Throw "Access out of boundary on string " + str
   return str[index]
end function


I don't see a reason all should suffer with slower speeddue to stuff that is not officially in and that is only needed by programmers not taking care of what they actually do. (its not like string access is that high dynamic that you can not check for boundaries yourself, right)