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 / Is it possible to pass a Two Dimensional String Array as a reference in AGK V2.0.10

Author
Message
Muckypaws
AGK Developer
13
Years of Service
User Offline
Joined: 21st Oct 2011
Location:
Posted: 1st Feb 2015 13:09
Hello,

More String Array queries from me.

Is it possible, or what is the correct way to define a multidimensional string array in AGK2 and pass this as a reference to a function in AGK2?

For single dimension I can use



However for multidimension string arrays, this always results in an error.

For example




Kind Regards
Jason

https://www.facebook.com/WonkyPix
http://www.wonkypix.com
http://www.appstore.com/jsecconsultancyltd
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 1st Feb 2015 16:52 Edited at: 1st Feb 2015 16:53
in alpha 7.1 i got no error at compile & run.
maybe u need define arrays in new syntax.
http://www.appgamekit.com/documentation/guides/12_array_changes.htm

AGK 108 (B)19 + AppGameKit V2 Alpha .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 1st Feb 2015 18:13
yes you can...but the way you have written it appears strange to me.



this will be a global string set by default

then



this way works perfectly you just need to remember that an array dim is global

www.sheldonscreations.com
Muckypaws
AGK Developer
13
Years of Service
User Offline
Joined: 21st Oct 2011
Location:
Posted: 1st Feb 2015 18:38
Hi Softmotion and Markus,

Thanks for your replies, unfortunately is doesn't address the issue of passing string arrays by reference, which is a feature of AGK2.

The first code snippet example shows you how that works in AppGameKit for a single dimension string array.

I can pass a multidimensional array using Integers defined in the way I described in the original post, however it doesn't work with String Arrays.

I'm aware there's an initialisation issue with Paul awaiting to be resolved, and it could be that this bug has been extended to MultiDimension string arrays.

Kind Regards
Jason

https://www.facebook.com/WonkyPix
http://www.wonkypix.com
http://www.appstore.com/jsecconsultancyltd
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 1st Feb 2015 19:12 Edited at: 1st Feb 2015 19:12
for me it works , also with 2.0.10


AGK 108 (B)19 + AppGameKit V2 Alpha .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Muckypaws
AGK Developer
13
Years of Service
User Offline
Joined: 21st Oct 2011
Location:
Posted: 2nd Feb 2015 00:08
Hi Markus,

Thank you.

You're solution helped, turned out I'd defined the String Array in the wrong order but the compiler accepted it!

Now all up and running and working.

Great Stuff

Kind Regards
Jason

https://www.facebook.com/WonkyPix
http://www.wonkypix.com
http://www.appstore.com/jsecconsultancyltd
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 2nd Feb 2015 00:37
ok.
maybe post this issue in this thread "AGK Version 2.0.10".

AGK 108 (B)19 + AppGameKit V2 Alpha .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)

Login to post a reply

Server time is: 2024-11-25 16:33:20
Your offset time is: 2024-11-25 16:33:20