"Sputnik" help  
Sputnik Help
Until (<condition>)
{
statements
...
}

Description

A until loop statement repeatedly executes a target statement as long as a given condition is false.

Parameters

<condition> The condition is evaluated just like an If statement. If it is false, the body of the loop is executed. If it is true, the body of the loop does not execute and flow of control jumps to the next statement just after the for loop.

Remarks

Until statements may be nested.

The expression is tested before the loop is executed so the loop will be executed zero or more times.

The Until loop in Sputnik is a variation of the While loop, where the code block is executed until a specified condition becomes true. It shares a similar syntax and behavior to the do-while loop found in some programming languages.

Unlike the While loop, the condition in the Until loop is evaluated after each iteration. If the condition is false, the code block is executed again. The loop continues until the condition becomes true.

It's important to ensure that the condition used in the Until loop is properly defined to eventually become true. Without a condition that can evaluate to true at some point, the loop will continue indefinitely, causing the program to hang or crash.

Related

Loop Statements
Continue Statement
Redo Statement
Break Statement

Example

Basic Example:

my $i = 0;
Until ( $i >= 5 )
{
    say "Value is: " . $i;
    $i++;
}
// PRINTS
// Value is: 0
// Value is: 1
// Value is: 2
// Value is: 3
// Value is: 4

 


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org