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 / Initializing bidimentional array

Author
Message
MobileCreator
12
Years of Service
User Offline
Joined: 1st Jun 2011
Location: Ottawa - Canada
Posted: 15th Aug 2012 07:00
Hi

the doc show that it is possible to initialize an array using:

dim a [ 5 ] as integer = [ 10, 20, 30, 40, 50 ]

Is there a similar way to initialize a bidimentional array like:

Dim b[5,5] = ???

Thanks

Paulo

----------
Paulo
http://www.mobilecreators.com
erebusman
12
Years of Service
User Offline
Joined: 23rd Jul 2011
Location: Sacramento, CA
Posted: 15th Aug 2012 07:08
Well in tier 2 it would be like this for an 8 x 8 array:



See if you can use syntax similar (so comma separated perhaps?)

Also check the sourcode of the examples that came with it maybe listed in there?
erebusman
12
Years of Service
User Offline
Joined: 23rd Jul 2011
Location: Sacramento, CA
Posted: 15th Aug 2012 07:13
Think I found it check out


C:/AGK/IDE/Help/principles/1_datatypes.htm

(adjust your path per your install)



So just reference the position when you initialize it.
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 15th Aug 2012 11:52
Read through this thread, especially the 3rd post.

MobileCreator
12
Years of Service
User Offline
Joined: 1st Jun 2011
Location: Ottawa - Canada
Posted: 17th Aug 2012 22:28
Shame on me. I didn't see similar questions so close in the forum...

Anyway, with the information I could setup my array properly. I did that using sequencial values to figure out how the data is stored. The result is not "natural" but comments in the code will make me remember why the "weird" order.

Cheers


Paulo

----------
Paulo
http://www.mobilecreators.com

Login to post a reply

Server time is: 2024-05-06 08:56:46
Your offset time is: 2024-05-06 08:56:46