DIMDEL issues?

Previous topic - Next topic

Gary

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

Kitty Hello

I did. Oh dear!!!
Please post a full example of the bug to reproduce it. So sorry :(

Gary

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

Gary

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

MrTAToad

Seems to work okay in 109...

Kitty Hello

Dimdel only works on 1D arrays.

Slydog

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

My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Gary

dimdel used to work on 2d arrays though

MrTAToad

I believe Gernot has mentioned that DIMDEL only works with one dimensional arrays in the past...

Gary

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

Kitty Hello

OK, I will allow it for multi-arrays then. Oh my. Did I really put that in the manual?

MrTAToad


ampos

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.

;/
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Kitty Hello

already works.

ampos

LOL

Sorry mate, I should check it before.
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE