Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Referring multidimensional object???

Avatar

Level 2

Not a programmer and it is my first time working with multidimensional object.

I have a table with  fields "MaxDepth" and "TotalDiveTime" and need to refer my variables (Rep1, Rep2, Rep3) to the multidimensional table as illustrated so that I can to run the script that follow to get the needed value in another field of the table refer here as Rep3.

812205_pastedImage_2.png

Any assistance would be much appreciated.

2 Replies

Avatar

Level 10

Hi,

you have to declare the object that holds the desired date first.

Then you can read the desired date the following way:


var repTable = {


  a : {a1: 111, a2: 112},


  b : {b1: 221, b2: 222}


  },


  repA = repTable['a']['a1'],


  repB = repTable['b']['b2'];



xfa.host.messageBox(repA.toString());


Hope this helps.