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 / app crash when accessing array out of bounds

Author
Message
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 26th Apr 2013 00:56
With normal arrays you'll get a typical out of bounds error message. Same thing if you have an array of UDT which consists of only a single variable. But if your UDT has 2 or more variables, accessing an array element outside of the allocated range will result in a generic app crash.

Even more strangely, after running this snippet multiple times, eventually it would run without any errors at all.




Ok, now I'm confused. There's definitely a bug somewhere, but it seems inconsistent.

This reports subscript out of bounds:


However, define the array with 2 instead of 1 element, and it'll run; despite the fact it's using the 5 index.

"You're all wrong. You're all idiots." ~Fluffy Rabbit
Marl
12
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 26th Apr 2013 19:33
Maybe the compiler is as confused as the users by the "0 based / 1 based array" connundrum, so it gives you an extra slot just in case
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 26th Apr 2013 19:38
This is a known issue.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 26th Apr 2013 23:08
And that is why I ask the ancient one for guidance before posting a new bug on google.

"You're all wrong. You're all idiots." ~Fluffy Rabbit
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 26th Apr 2013 23:40
Ah yes, that was a fun one for me to find... along with the 0/1 array conundrum as Marl puts it.
Also watch out for multidimensional arrays losing data when resized. I do think that one's fixed though.

www.NaplandGames.com

Login to post a reply

Server time is: 2024-05-02 14:24:36
Your offset time is: 2024-05-02 14:24:36