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.

AppGameKit Classic Chat / dim some multi dimensional array[] trouble

Author
Message
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 9th Aug 2012 11:07
there are no DBP alike array insert at bottom command exists, so i am use the dim command instead. but in case if it is multi-dimensional array some strange things are happens.

try this code:


hereupon look in output.txt. not expected, didn\'t?

meanwhile all works finely, if to try this:


but this method does not correspond to the paradigm of what is given in Help Files\'s lottery$[] example.

error #0101:
- english language conflicts with a brains of this rabbit.
free fonts for your AGKs!
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 9th Aug 2012 12:04
You need to dim the array before the "for" loop not during it.



this.mess = abs(sin(times#))
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 9th Aug 2012 12:35
There's a bug when it comes to resizing multidimensional arrays via DIM; mainly it results in loss of data. Baxslash's solution is the best for now.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 9th Aug 2012 12:48
When resizing you would have to copy the existing data into a temporary array and then back into the original array before adding any new data. Not sure what the plans are for fixing the bug, I wasn't aware of it until now.


this.mess = abs(sin(times#))
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 9th Aug 2012 16:51
The bug has been tagged as confirmed and we should expect that it will be fixed, hopefully during the next bug fix cycle.

Cheers,
Ancient Lady
AGK Community Tester
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 9th Aug 2012 19:46
Quote: "You need to dim the array before the "for" loop not during it."

it is just sample. in my projects i don't know beforehand the quantity of some arrays.
Quote: "copy the existing data into a temporary array"

this option is good if it does not happen too often.

error #0101:
- english language conflicts with a brains of this rabbit.
free fonts for your AGKs!
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 12th Aug 2012 12:39
I read the title as Dim Sum

So to recap, there is a quick fix [baxslash thanks]

and it is likely to be fixed sometime soon... thanks TGC

I need to study more AppGameKit asap...

Login to post a reply

Server time is: 2024-04-28 06:15:59
Your offset time is: 2024-04-28 06:15:59