[Loop_Count] returns the number of the current repetition of any looping method.
When used with the [Loop] method, it obeys the optional parameters so the [Loop_Count] can run backward or forward by the specified loop increment -By parameter.
This method can be used with the [Loop], [While], or [Records] methods, or any other looping conditional methods. Note: [Loop_Count] cannot be used within an included file to get the current repetition of a method around the [Include] method in the including file. Instead, store the loop count in a variable.
loop_count
Use the [Loop_Count] method inside a looping method. The following example shows a loop counting backward from 5.
Code
loop(1, 5, -1)
'<br>This is repetition ' + loop_count
/loop
Result
This is repetition 5 This is repetition 4 This is repetition 3 This is repetition 2 This is repetition 1
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 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
Recent Comments