Kitty,
Have you changed anything in how arrays are handled recently?
I have a piece of code that logs the last 10 events and did it like this
DIMDEL coin_recall$[],0
REDIM coin_recall$[11][3]
coin_recall$[9][0] = coinname$[coin]
coin_recall$[9][1] = PLATFORMINFO$("TIME")
this now crashes the program with an error of DIM has wrong dimensions.
It was working find up till a couple of revisions ago
Gary
I did. Oh dear!!!
Please post a full example of the bug to reproduce it. So sorry :(
Kitty
The whole routine is
FUNCTION update_coin_recall:coin
DIMDEL coin_recall$[],0
REDIM coin_recall$[11][3]
coin_recall$[9][0] = coinname$[coin]
coin_recall$[9][1] = PLATFORMINFO$("TIME")
backup_coins()
ENDFUNCTION
It works fine in 10.090 but not on the latest version.Not sure what else you need to know
backup_coins() just dumps the array to a file so it can be loaded back in when the program is exited
just checked with the current build and am getting the same error
"J:\Dropbox\Dropbox\Video Random Gold\PC GLBasic\IO.gbas"(833) error : DIM has wrong dimensions
line 833 is the DIMDEL routine
Seems to work okay in 109...
Dimdel only works on 1D arrays.
Quote from: Kitty Hello on 2011-Sep-15
Dimdel only works on 1D arrays.
Is this a new change?
The following is from the Help info for 'DIMDEL', and suggests it was possible:
DIM a[3][2]
a[0][0] = 0
a[0][1] = 1
a[1][0] = 10
a[1][1] = 11
a[2][0] = 20
a[2][1] = 21
DIMDEL a[], 1
dimdel used to work on 2d arrays though
I believe Gernot has mentioned that DIMDEL only works with one dimensional arrays in the past...
its not a major issue if I was using an unsupported "feature", I can just write a quick shift routine to move things about, I think I used DIMDEL in about 4 places so its easy enough
OK, I will allow it for multi-arrays then. Oh my. Did I really put that in the manual?
Yup :)
Once you are on arrays...
Can you do to access arrays from the end?
array[-1] will be the last one
array[-2] the previous one
and so on.
;/
already works.
LOL
Sorry mate, I should check it before.
Same bug here! CanĀ“t recreate it with simple code, yet. Programs that worked for ages crash with an out of bounds error. Happens with dimdel. It is a 1d array!
Tried the update ?
Sorry, was a false alarm. I did change something! Eveything works fine again.