Lasso Soft Inc. > Home

[While] ... [/While]

[While] ... [/While] repeats the contents of the container tag until the condition specified in the opening tag returns False.

  • Syntax
  • Parameters
[While: Conditional Expression]
  ...
[/While]
Required Parameters
Conditional Expression The conditional expression which is executed on each repetition of the contents of the container tag.
Examples

To repeat a calculation until the desired result is achieved:

Use the [While] ... [/While] tags with an appropriate conditional expression. The following example calculates the Fibonacci numbers until one greater than 1000 is returned.

[Var: 'Fibonacci_One'=1]
[Var: 'Fibonacci_Two'=1]
[While: (Var: 'Fibonacci_One')<1000]
  [Var: 'Fibonacci_New'=(Var:'Fibonacci_One') + (Var:'Fibonacci_Two')]
  [Var: 'Fibonacci_Two'=(Var:'Fibonacci_One')]
  [Var: 'Fibonacci_One'=(Var: 'Fibonacci_New')]
[/While]
<br>[Var:'Fibonacci_One']
Result:
<br>1597
Tag Link [While] ... [/While] Category Conditional
Type Container Data Source Any
Support Preferred Version 2.5
Output Type None Security None
Implementation Internal 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