title: Javascript save variable outside of program
body: <p>I am writing a simple iterator script in a third party program:</p>
  
  <pre><code>var i = 1.
  function run(){
   output1 = i;
   i = i + 1;
  }
  </code></pre>
  
  <p>This function is run for every record. But the program works with batches of 25 records. So for 100 records it outputs 4 times 1 to 25. I have access to the java libs. It is a linux server. Can I put i in some kind of global java variable or memory, so i can live outside of my program? I tried reading and writing i to a text file. This works but is to slow giving me some empty's, ones and two's. Making the program wait would be my last option (how can I do that?</p>
  
  <p>I have no other easy way to add these numbers. I am limited by the program Oracle EDQ options.</p>