Lasso Soft Inc. > Home

[Repetition]

[Repetition] can be used in conditionals to perform tasks every nth repetition.

The repetition tag is a special tag that can only be used within a conditional expression. When compared with an integer value it returns True if the current [Loop_Count] is an even multiple of the value it is being compared against.

[If: (Repetition) == 2] ... [/If] will repeat the contents of the [If] ... [/If] tags every 2nd repetition.

[If: (Repetition) == 10] ... [/If] will repeat the contents of the [If] ... [/If] tags every 10th repetition.

  • Syntax
  • Parameters
[If: (Repetition) == Desired Repetition]
  ...
[/If]
Examples

To color every other row of a table:

Use the [Repetition] tag to check for every 2nd repetition of the container tag. If it is the 2nd repetition then change the color of the table cell.

<table>
[Loop: 4]
  <tr>
    <td [If: (Repetition) == 2]color="grey"[/If]>[Loop_Count]</td>
  </tr>
[/Loop]
</table>
Result:
<table>
  <tr>
    <td>1</td>
  <tr>
  <tr>
    <td color="grey">2</td>
  </tr>
  <tr>
    <td>3</td>
  <tr>
  <tr>
    <td color="grey">4</td>
  </tr>
</table>
Tag Link [Repetition] Category Conditional
Type Substitution Data Source Any
Support Deprecated Version 2.5
Output Type None Security None
Implementation LDML Sets Lasso 6.0, Lasso 5.0,LDML3x,LDML25

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft