Help Center
Help CenterFreeBASIC

Whilekeyword

Control flow statement.

Miscellaneous Keywordskeyworddocumented

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

Version


  • Since fbc 1.20.0: End While equivalent to Wend

Differences from QB


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

See also



Example


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.

Reference

  • Documented in KeyPgWhile.html