LassoScript Utility
Basics Browse Detail


Tag Link [Loop_Count] Category Conditional
Type Substitution Source Available No
Support Preferred Version 2.5
Change Unchanged Data Source Any
Output Type Integer Security None
Implementation Internal Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0, Lasso 2.5
Lasso 3 Equivalent [LoopCount]


[Loop_Count] returns the number of the current repetition of any looping container tag.

When used with the [Loop] ... [/Loop] tags it obeys the optional parameters so the [Loop_Count] can run backwards or jump ahead by the specified -LoopIncrement.

This tag can be used with the [Loop] ... [/Loop] tags, [While] ... [/While] tags, [Records] ... [/Records] tags or any other looping conditional tags.

Note: [Loop_Count] cannot be used within an include file to get the current repetition of a container tag around the [Include] tag. Instead, store the loop count in a variable.




No Parameters Required.


To return the number of the current repetition in a [Loop] ... [/Loop] tag:

Use the [Loop_Count] tag inside the [Loop] ... [/Loop] tags. The following examples shows a loop counting backwards from 5.

[Loop: -LoopFrom=5, -LoopTo=1, -LoopIncrement=-1]
  <br>This is repetiion [Loop_Count].

<br>This is repetition 5.
<br>This is repetition 4.
<br>This is repetition 3.
<br>This is repetition 2.
<br>This is repetition 1.

Related Tags

Category Tags