Copy link to clipboard
Copied
Trying to create a form field that would calculate / interpret a value to use for Rng based on given WT and Temp values.
Ex. At 20 degrees, and a WT of 20, my Rng will be 600. At a WT of 15, my Rng will be 537.
How can I use an array to help me calculate what my Rng value would be if my WT value falls anywhere in-between two of the listed WT values?
Thanks in advance for any and all help.
Yes if you use a multi-dimensional array.
Copy link to clipboard
Copied
Yes if you use a multi-dimensional array.
Copy link to clipboard
Copied
Ok great. Can you point me in the right direction for writing a multi-dimensional array ...?
I'm trying to look through the forum for some examples to better understand and build upon, but got stumped.
Copy link to clipboard
Copied
The Array object from MDN JavaScript Reference.
You first need to create the array, Then assign an array to a value in the first dimension to get the second dimension.
A sample script including loading the table and extracting from the table:
var RngTable = new Array();
RngTable[20] = [null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,"600",
null,null,null,null,null,null,null,null,null,"632"];
RngTable[15] = [null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,"537",
null,null,null,null,null,null,null,null,null,"600"];
RngTable[10] = [null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,"472",
null,null,null,null,null,null,null,null,null,"545"];
var nWT = 10, nTEMP = 30;
console.println("WT: " + nWT + " and TEMP: " + nTEMP + " is " + RngTable[nWT][nTEMP]);
Find more inspiration, events, and resources on the new Adobe Community
Explore Now