Menu

do...while loops

Mark Anthony Taylor (Shyreman)

Do...while loops have the following syntax:

(do while <condition> )</condition>

The do...while loop executes and evaluates the binary valued expression <condition>. If the
<condition> evaluates to true execution of the loop begins again.</condition></condition>

If executes a (break) directive, which is not itself in some other loop construct, then
execution of the loop will terminate. If executes a (continue) directive, which is not itself in some other loop construct, then the execution of the body begins again.

Examples:

(Int32 i = 0)
(do 
    (i = (i+1))
    while (i < 5)
)

(i = 0)
(do 
    (i = (i+1))

    (if (i == 5) 
        break)
    )
    while true
)

(i = 0)
(do
    (i = (i+1))

    (if (i != 5) 
        continue
        else
        break
    )
    while true
)

Related

Wiki: Content