GLBasic forum

Main forum => Bug Reports => Topic started by: Gary on 2011-Sep-14

Title: DIMDEL issues?
Post by: Gary on 2011-Sep-14
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

Code (glbasic) Select

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
Title: Re: DIMDEL issues?
Post by: Kitty Hello on 2011-Sep-14
I did. Oh dear!!!
Please post a full example of the bug to reproduce it. So sorry :(
Title: Re: DIMDEL issues?
Post by: Gary on 2011-Sep-14
Kitty

The whole routine is

Code (glbasic) Select

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
Title: Re: DIMDEL issues?
Post by: Gary on 2011-Sep-14
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
Title: Re: DIMDEL issues?
Post by: MrTAToad on 2011-Sep-14
Seems to work okay in 109...
Title: Re: DIMDEL issues?
Post by: Kitty Hello on 2011-Sep-15
Dimdel only works on 1D arrays.
Title: Re: DIMDEL issues?
Post by: Slydog on 2011-Sep-15
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:
Code (glbasic) Select
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

Title: Re: DIMDEL issues?
Post by: Gary on 2011-Sep-15
dimdel used to work on 2d arrays though
Title: Re: DIMDEL issues?
Post by: MrTAToad on 2011-Sep-15
I believe Gernot has mentioned that DIMDEL only works with one dimensional arrays in the past...
Title: Re: DIMDEL issues?
Post by: Gary on 2011-Sep-15
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
Title: Re: DIMDEL issues?
Post by: Kitty Hello on 2011-Sep-15
OK, I will allow it for multi-arrays then. Oh my. Did I really put that in the manual?
Title: Re: DIMDEL issues?
Post by: MrTAToad on 2011-Sep-15
Yup :)
Title: Re: DIMDEL issues?
Post by: ampos on 2011-Sep-15
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.

;/
Title: Re: DIMDEL issues?
Post by: Kitty Hello on 2011-Sep-15
already works.
Title: Re: DIMDEL issues?
Post by: ampos on 2011-Sep-15
LOL

Sorry mate, I should check it before.
Title: Re: DIMDEL issues?
Post by: monono on 2011-Sep-17
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!
Title: Re: DIMDEL issues?
Post by: MrTAToad on 2011-Sep-18
Tried the update ?
Title: Re: DIMDEL issues?
Post by: monono on 2011-Sep-18
Sorry, was a false alarm. I did change something! Eveything works fine again.