Skip to content
Paul Squires edited this page Oct 14, 2026 · 2 revisions

Home › Miscellaneous Keywords › While

While

Control flow statement.

Syntax

Do While condition
[statement block]
Loop
Do
[statement block]
Loop While condition
While [condition]
[statement block]

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.

Remarks

Differences from QB

  • None, except for the End While syntax (equivalent to Wend) specific to FreeBASIC.

See also

Examples

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.

Category: Miscellaneous Keywords
Kind: keyword


Reproduced from the FreeBASIC Wiki Manual under the GNU Free Documentation License 1.3 — with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. Copyright © the FreeBASIC project and wiki contributors. See License.

Clone this wiki locally