title: How do I loop an array in imacros?
body: <p>I would like to loop "pin_board" and replace the "boardarray" every time it loops.. here is the code below..`</p>
  
  <pre><code>var boardarray = ['board1', 'board2', 'board3', 'board4', 'board5'];
  
  var text = 'pin_board';
  
  for(var i in boardarray) {
  
  
  pin_board = "CODE:";
  pin_board += "VERSION BUILD=8300326 RECORDER=FX" + "\n";
  pin_board += "TAB T=1" + "\n";
  pin_board += "TAG POS=1 TYPE=BUTTON ATTR=TXT:Pin&lt;SP&gt;it" + "\n";
  pin_board += "WAIT SECONDS=3" + "\n";
  pin_board += "TAG POS=1 TYPE=LI ATTR=TXT:" + boardarray + "\n";
  pin_board += "WAIT SECONDS=3" + "\n";
  pin_board += "TAG POS=R1 TYPE=BUTTON ATTR=TXT:Pin&lt;SP&gt;it" + "\n";
  pin_board += "WAIT SECONDS=5" + "\n";
  
  }
  iimPlay(pin_board);
  </code></pre>
  
  <p>Thanks for the reply @karaxuna.. I modify my script and tried it on imacros.. unfortunately, it only loop once and instead of starting with board1 it started and ends in baord5. So it only run once. I don't know if I miss something.</p>
  
  <p>Here is the edited code..</p>
  
  <pre><code>var boardarray = ['board1', 'board2', 'board3', 'board4', 'board5'];
  
  var text = 'pin_board';
  
  for(var i = 0; i &lt; boardarray.length; i++)
  {
  pin_board = "CODE:";
  pin_board += "VERSION BUILD=8300326 RECORDER=FX" + "\n";
  pin_board += "TAB T=1" + "\n";
  pin_board += "TAG POS=1 TYPE=BUTTON ATTR=TXT:Pin&lt;SP&gt;it" + "\n";
  pin_board += "WAIT SECONDS=3" + "\n";
  pin_board += "TAG POS=1 TYPE=LI ATTR=TXT:" + boardarray[i] + "\n";
  pin_board += "WAIT SECONDS=3" + "\n";
  pin_board += "TAG POS=R1 TYPE=BUTTON ATTR=TXT:Pin&lt;SP&gt;it" + "\n";
  pin_board += "WAIT SECONDS=5" + "\n";
  
  }
  iimPlay(pin_board);
  </code></pre>
  
  <p>thanks,</p>