Page 1 of 1

[RTM] Out of Bounds Array

Posted: Thu Apr 10, 2014 11:51 pm
by IdeasVacuum
PB5.22LTS x86 (Tested PB4.61 too)
Just came across an odd little issue - the compiler will create an exe from this code without flinching:

Code: Select all

Global Dim sgName.s(5)

sgName(01) = "Name01"
sgName(02) = "Name02"
sgName(03) = "Name03"
sgName(04) = "Name04"
sgName(05) = "Name05"
sgName(06) = "Name06"

End
Surely compilation should halt at sgName(06)? Compile/Run does.

Re: Out of Bounds Array

Posted: Fri Apr 11, 2014 12:13 am
by Demivec
IdeasVacuum wrote:Surely compilation should halt at sgName(06)? Compile/Run does.
PureBasic Help File: Dim, wrote:Note: Array bound checking is only done when the runtime Debugger is enabled.

Re: Out of Bounds Array

Posted: Fri Apr 11, 2014 12:17 am
by IdeasVacuum
:oops: