Nested While Loop
<p>I am having trouble getting this nested while loop to work. I am using a Javascript based program that reads from 2 table columns based on the Header of the table. I am able to read from the tables but the loop is not working. My goal is to find when the neutral size of a wire becomes larger than the phase size and print the wire size at which this occurs. The code is as follows. </p>

<pre><code> CSA = 130
 NeutCSA = 0
 i = 0
 j = 0

 while (NeutCSA &lt; CSA){
      j = 0
      while (NeutCSA &lt; CSA){
           NeutCSA = colWireSize[i] * colNumberWires[j]
           if (colNumberWires[j] &lt; 18){
                 j = j + 1
           }
      }
      if (colWireSize[i] &lt; 10){
           i = i + 1
      } 
 }
 result = colNumberWires[j]
</code></pre>

<p>The tables look like this</p>

<p>colWireSize
2
3
4
5
6
7
8
9
10</p>

<p>colNumberWires
6
7
8
9
10
11
12
13
14
15
16
17
18</p>

<p>The program will find the condition and end the loop but not in the order I need it to. I need it to start at the first row of WireSizes and then loop through and multiple that value by NumberWires. If this value is less then CSA, go to the next WireSize and repeat the process until NeutCSA > CSA.</p>

<p>Thanks
Pat</p>
