FOR Element


FOR (a child element of STEP) is much like the for used in programming. A for loop repeats until a specified condition evaluates to false.

Supported Values

FOR supports the use of its own child elements as values. For a list of supported child elements please refer to the tree menu on the left.

Examples

In this example, a for loop is created by setting the initial variable as _Var_ with the value as 0, and being incremented by 1 after each loop as long as the value of _Var_ is smaller than 10 (ie. 10 loops in total). During each loop, the value of _Var_ is displayed.

  • <STEP>
    • ......
    • <FOR>
      • <INITIAL>
        • <VARIABLE>
          • <NAME>_Var_</NAME>
          • <VALUE>0</VALUE>
        • </VARIABLE>
      • </INITIAL>
      • <CONDITION>
        • <SMALLER>
          • <LEFT>_Var_</LEFT>
          • <RIGHT>10</RIGHT>
        • </SMALLER>
      • </CONDITION>
      • <INCREMENT>1</INCREMENT>
      • <LOOP>
        • <JAVASCRIPT>alert("The value of _Var_ is" + XMLVar._Var_);</JAVASCRIPT>
      • </LOOP>
    • </FOR>
    • ......
  • </STEP>