Show TOC

repeat with <reg> from <expn> to <expn>Locate this document in the navigation structure

Use

Purpose

Repeats a substitution using a loop index.

Syntax

repeat with <register> from <expression> to <expression> [by <expression>] statement end

Description

With repeat with <reg> in <field>, iteration is only possible over a single step loop column.

If you want to iterate over several columns in parallel, the individual field values should be activated using an index. To get this running index, use the repeat with... from variant. This variant sets the register to the from value and iterates over all values up to the to value. Using by, you can specify an increment other than 1.

Example
<table>
 `repeat with index from 1 to xlist-posnr.dim`
  <tr>
   <td> `xlist-posnr[i]`  </td>
   <td> `xlist-matnr[i]`  </td>
   <td> `xlist-arktx[i]`  </td>
   <td> `xlist-kwmeng[i]` </td>
  </tr>
 `end`
</table>
         

To output the above table in reverse sequence, do the following:

<table>
 `repeat with index from xlist-posnr.dim to 1 by "-1" `
  <tr>
   <td> `xlist-posnr[i]`  </td>
   <td> `xlist-matnr[i]`  </td>
   <td> `xlist-arktx[i]`  </td>
   <td> `xlist-kwmeng[i]` </td>
  </tr>
 `end`
</table>
         
More Information

For further information, see: