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 / [V 108.21 - Tier1] Array Bug (with String) ?

Author
Message
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 14th Apr 2014 16:17
Hi

Do you know why this code doesn't work properly ?



If it's a bug, where can I post (bug report) ?

Thanks

http://www.dracaena-studio.com
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 14th Apr 2014 20:07
What's not working properly about it?
I know that the compiler/parser has issues with array declarations. The space after the = and before the [ seems to be an issue.

I'd declare like this:

dim test$[19] =["3" , "4" , ... ]

Declarations work like that for me in 10819

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 15th Apr 2014 04:55
I think the 'dim xxx as xxx = [xxx]' does not work quite right.

If you do as Naphier shows and us the '$' to declare the array as string, it might work.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 15th Apr 2014 07:03
If I remember correctly you shouldn't ever declare anything as a type then set it equal to something. For example,

will occasionally cause strange issues. That could be your problem. I can't remember if the issue was completely fixed, but to be safe I always avoid it. Find a way to lay it out like,


Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 15th Apr 2014 10:00 Edited at: 15th Apr 2014 10:03
Hi


Thank you for your answers. Someone has tried to run my first code ? It works on your PC ?
Because, on my PC, it doesn't work. I'm under win8 with AppGameKit 108.21 (Perhaps it's a bug with the RAM (I have 2 Go)). When I run my first code, I have my two messages with "" (should be "3" and "99992356999999").





In fact, I think the bug is a problem with the len of the parameters in the array. If I make that :

It's ok, and works well .
I have the good result (in the message()) :
test[0] = "3"
test[1] = "99992356999999"
etc...


But if I do :


It doesn't work no more. I have as result (in the message()) :
test[0] = ""
test[1] = ""
etc....


So I think, it's a bug with the len of the parameters between [].
I have tried all of your suggestions, but, it doesn't work:



To result this bug, I have to do that :


And it works.

http://www.dracaena-studio.com
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 15th Apr 2014 16:43
Sounds like a bug.
I declare a lot of very long integer arrays on a single line so it must be the strings.
I just found a bug with undim yesterday.
If you undim a nonexistent array it will delete the data in a global... Should throw an error, but it doesn't.

Login to post a reply

Server time is: 2024-04-26 23:30:00
Your offset time is: 2024-04-26 23:30:00