Lasso Soft Inc. > Home

[ loop_abort ]

Method

[Loop_Abort] aborts the [Loop] or [While] containers, exiting immediately and not executing any further repetitions of the loop.

The [Loop_Abort] method can be used to abort any looping container method including [Records].

  • Syntax
Loop(Loop Count) => {
    Loop_Abort
}

While(Conditional Expression) => {
    Loop_Abort
}
Examples
  • Beginner

To abort a [While] loop when a value is found:

Use the [Loop_Abort] method. The following example shows a [Loop] loop which performs a calculation until a negative value is found and [Loop_Abort] is called.

The variable result returns -1 at the end since (50-51) is less than 0.

Code

Loop(100) => {
    var(Result = 50 - loop_count)
    $Result < 0 ? loop_abort
}
$Result

Result

-1

Recent Comments

No Comments found

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