Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Help trying to calculate and/or interpret value from table data

Community Beginner ,
Sep 19, 2016 Sep 19, 2016

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.

Screen Shot 2016-09-19 at 2.40.02 PM.png

TOPICS
Acrobat SDK and JavaScript
676
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Sep 19, 2016 Sep 19, 2016

Yes if you use a multi-dimensional array.

Translate
LEGEND ,
Sep 19, 2016 Sep 19, 2016

Yes if you use a multi-dimensional array.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 19, 2016 Sep 19, 2016

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 19, 2016 Sep 19, 2016
LATEST

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]);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines