Skip to content

WHILE

Source: https://www.freebasic.net/wiki/wikka.php?wakka=KeyPgWhile Last revised: 2020-01-25

Control flow statement — loop condition keyword.

Syntax

Do While condition
    [statement block]
Loop

or

Do
    [statement block]
Loop While condition

or

While [condition]
    [statement block]
Wend

Description

While specifies that a loop block will continue if the condition following it evaluates as true. This condition is checked during each loop iteration.

Examples

vb
Dim a As Integer
a = 0
Do While a < 10
    Print "hello"
    a = a + 1
Loop
'This will continue to print "hello" on the screen while the condition (a < 10) is met.

Differences from QB

  • None.

See Also

Translated from FreeBASIC official docs. Contact us for removal if infringed.
FreeBASIC is an open-source project, not affiliated with Microsoft