# Repeating (looping)

### @index <a href="#index" id="index"></a>

* no parameters
* returns a whole number

`@index` — no parameters or parentheses necessary — returns the current iteration number if this function is called from within a “loop”, i.e. when the software cycles between the elements of a list. This is for example the case when [repeating a row in a table](https://help.clause9.com/clauses/introduction-to-tables#repeating-rows), or when going through repeating clauses. `@index` will return zero if used outside a loop.

For example, if `#customer^name` is a repeating list that contains the names “John Smith”, “Jane Doe” and “Marie Thompson”, then the following output would be produced in a table with a repeating-row . The @index starts at 1, and is then incremented with each additional row, until the end of the loop.

<figure><img src="https://1353649376-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaTEDNbiFdDa6DW2eNG17%2Fuploads%2FXbbEE7y54HwuIxTM9lai%2Fimage.png?alt=media&#x26;token=8d98db38-f1d4-4fb7-8fae-dea579e6a0f1" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Note that (unlike most programming languages) the returned number is one-based, i.e. the first iteration in a loop will be one (not zero).
{% endhint %}

{% hint style="success" %}
To get the row-index in the context of a [Q\&A column condition](https://help.clause9.com/qna/adding-conditions), use `@row-index` instead.
{% endhint %}
