Debugging arrays

Blitz3D Forums/Blitz3D Beginners Area/Debugging arrays

Spikenspan(Posted 2003) [#1]
I am not able to view the contents of an array in debug. Here's the code:

Dim v_cubes( 1, 1, 1 )
v_cubes(0,0,0) = 9

Any idea?

Thanks.


DarkEagle(Posted 2003) [#2]
thats odd.

i seem to remember i also sometimes have problems with stuff like this, but only in debug mode. in non-debug mode it runs fine. i have no idea what causes it either. does it give an array index out of bounds?


Spikenspan(Posted 2003) [#3]
The following debug log lines:

Dim v_cubes( 1, 1, 1 )
DebugLog v_cubes(0,0,0)
v_cubes(0,0,0) = 9
DebugLog v_cubes(0,0,0)

do output:
0
9

Looks like the array is fine, I simply cannot debug it. Bugger.


DarkEagle(Posted 2003) [#4]
odd... i can debug it fine. tried restarting IDE/pc?


GfK(Posted 2003) [#5]
If you mean that you can't see the contents of an array in the debugger - no you can't! It'd be hugely complicated to do that for multi-dimensional/large arrays.

The best you can do is to write a simple function to either dump the contents of the array into a file, or into the DebugLog (as you're already doing).


Spikenspan(Posted 2003) [#6]
GFK: that's exactly what I meant! Ok, so it is not possible see array contents in debug. Fair enough.

Thanks everyone for you replies!


Sir Gak(Posted 2003) [#7]
Maybe, for debug purposes, you can copy the array contents into a simple variable, and then THAT should show in debug mode:

Dim v_cubes( 1, 1, 1 ) 
v_cubes(0,0,0) = 9 
my_vcubes = v_cubes(0,0,0)



Spikenspan(Posted 2003) [#8]
I think I'm gonna go with a dump in the debug log. I really need to see the whole array data in a single glance.

Thanks!


DarkEagle(Posted 2003) [#9]
i thought this had something to do with the arrays work fine in none debug mode, but give an error in debug mode...

i get that problem sometimes :/