Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - MultiDimensional Array
  FAQ FAQ  Forum Search   Register Register  Login Login


Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

MultiDimensional Array

 Post Reply Post Reply
Author
mhoney View Drop Down
New Member
New Member


Joined: 17 Dec 2013
Location: Australia
Points: 34
Post Options Post Options   Quote mhoney Quote  Post ReplyReply Direct Link To This Post Topic: MultiDimensional Array
    Posted: 27 Apr 2014 at 3:10am
Hi guys,

I was hoping you might be able to assist me with some example code of a multidimensional array.

I have tried a few things but not working within the Adobe Java editor.

var multiDim = [1,2,3,4,5] [6,7,8,9,10];
app.alert(multiDim[0][3]);

If you are able to advise me on the mistake(s) I am making it would be a great help.

Thanks.

Michael.Smile
Michael.
Back to Top
Sponsored Links


Back to Top
gkaiseril View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Location: USA
Points: 4106
Post Options Post Options   Quote gkaiseril Quote  Post ReplyReply Direct Link To This Post Posted: 27 Apr 2014 at 3:38am
You did not define an array variable.

var multiDim = [1,2,3,4,5] [6,7,8,9,10];
app.alert(multiDim[0][3]);
Back to Top
gkaiseril View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Location: USA
Points: 4106
Post Options Post Options   Quote gkaiseril Quote  Post ReplyReply Direct Link To This Post Posted: 27 Apr 2014 at 5:48pm
To walk the array:

var multiDim = new Array([1,2,3,4,5],
[6,7,8,9,10]);
// app.alert(multiDim[0,3]);
for(i = 0; i < multiDim.length; i++) {
console.println("multiDim[" + i + "]: " + i);
for(j = 0; j < multiDim[0].length; j++) {
console.println("multiDim[" + i + "].[" + j + "] : " + multiDim[j]);
}
}

Back to Top
mhoney View Drop Down
New Member
New Member


Joined: 17 Dec 2013
Location: Australia
Points: 34
Post Options Post Options   Quote mhoney Quote  Post ReplyReply Direct Link To This Post Posted: 27 May 2014 at 9:03am
Thanks so much for the advice.  I am definitely on the right track now.

Michael.
Michael.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.047 seconds.