When I have a huge DIMDATA spread over multiple lines using the " _", gpc.exe crashes.
When I say huge I mean nearly 1000 lines of 32 ints.
I don't really want to resort to loading them in from a binary file as the data is still being tweaked.
Can you make the DIMDATA lines available ?
Here you go. (http://www.andynoble.co.uk/DimData.gbas) It exceeded the maximum characters for a post.
Dimdata is realy only for very small amounts of data, for easy storage of levels, try this approach:
GLOBAL level[]
GLOBAL w, h
loadlevel()
WHILE 1
drawscreen()
SHOWSCREEN
WEND
FUNCTION drawscreen:
FOR y = 0 TO h-1
FOR x = 0 TO w-1
PRINT " "+level[x][y], x*20, y*20
NEXT
NEXT
ENDFUNCTION
FUNCTION loadlevel:
LOCAL a
RESTORE level1
READ w // Get the size of the level
READ h
REDIM level[w][h] // New size of array
FOR y = 0 TO h-1
FOR x = 0 TO w-1
READ a // Read data for one cell
level[x][y] = a
NEXT
NEXT
ENDFUNCTION
STARTDATA level1:
DATA 4, 5 // width and height
DATA 0, 0, 0, 1 // Level data
DATA 0, 0, 0, 1
DATA 0, 0, 0, 1
DATA 0, 0, 0, 1
DATA 0, 0, 0, 1
ENDDATA
Cheers Moru.
Yeah, I know that approach. I just wanted a simple data set while I was starting development and the DIMDATA was perfect for it. In the end the data will be loaded as binary anyway. I was just pointing out there might be a problem with the compiler.
Cheers again.
Well, I don't think the compiler should crash...
It appears DIMDATA can take up to 24394 items. Its a rather odd number, but one item more and the compiler crashes
Great! The debug version does run. It's only the release that crashes. I'd be happy if you could make DIMDATA with DIM and a loop instead.
You cant get out of it that easily :)
bugs only happening in release are about a day to debug each. I don't have that time. :(
Quote from: BigAnd on 2009-Oct-24
Here you go. (http://www.andynoble.co.uk/DimData.gbas) It exceeded the maximum characters for a post.
Yikes! That's quite possibly the biggest single line I have ever seen in a program listing! :P
LOL! Yeah it is a bit big!
I have a work around at the moment anyway. I am hosting my data in BlitzMax, it writes out a binary file and then copies it into my media directory. It works well and is really only one extra button press.
Hopefully at some point in the not-too-distance future, it'll be fixed in release mode...