Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Bug Reports / U5.9 Beta 3 - Re-DIM'd arrays are one element too big

Author
Message
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 13th Nov 2005 20:01
Run the code and see.



BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 14th Nov 2005 15:37


You shouldn't be dimming an array twice without undimming it. The problem, in my opinion is that it let you do it twice without slapping your wrists.

Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 14th Nov 2005 17:34
But doing that would mean there would be problems with re-sizing the array inside a function. Phh, I may as well switch to using EMPTY ARRAY followed by ARRAY INSERT AT BOTTOM.

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 14th Nov 2005 20:30
It's OK to dim an array a second time. It was Lees way of allowing us to resize a multidimensional array.

It also explains a problem I've noticed in a piece of code I wrote and didn't manage to track down at the time - I thought it was something I was doing.

For free Plug-ins and source code http://www.matrix1.demon.co.uk
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Nov 2005 12:28
OK...so we have REDIM PRESERVE? Nice

Login to post a reply

Server time is: 2024-04-26 23:06:35
Your offset time is: 2024-04-26 23:06:35