noobish question

Blitz3D Forums/Blitz3D Beginners Area/noobish question

Bot Builder(Posted 2003) [#1]
I dunno. For whatever reason my string array brings up the error "Array index out of bounds" when I try to set it to a value. Obviously, this means my index is to large/small. But I checked, and it was one. my array is defined as having 1000 elements. Vero odd. I can reproduce it in smaller code, and I don't want to post my large code.


Floyd(Posted 2003) [#2]
I'll have to see this to believe it.


Bot Builder(Posted 2003) [#3]
I'll try to narrow it down to some code....

whoops. mistype. I meant "I cant produce it in smaller code, and I dont want to post my large code"


Bot Builder(Posted 2003) [#4]
Configure

Dim unused$(1000)
Global unc

Function configure()
 fil$="hi"
 unc=1
 unused$(unc)=fil$
End Function


for whatever reason, this produces the error. Is it just me?


Floyd(Posted 2003) [#5]
This happens because you are calling Configure before the array has been Dimensioned.


Bot Builder(Posted 2003) [#6]
ah.

makes since. I was under the impresion that the preproccessor checked for dim. oh well. noodbish question, as I said. Thanks!


WolRon(Posted 2003) [#7]
The preprocessor doesn't check for Dim because you can reDim arrays later so it must be Dimmed at runtime.