[RTM] Out of Bounds Array

Windows specific forum
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

[RTM] Out of Bounds Array

Post 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.
Last edited by IdeasVacuum on Fri Apr 11, 2014 12:19 am, edited 1 time in total.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Demivec
Addict
Addict
Posts: 4270
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: Out of Bounds Array

Post 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.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Out of Bounds Array

Post by IdeasVacuum »

:oops:
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply