WHILE
来源: https://www.freebasic.net/wiki/wikka.php?wakka=KeyPgWhile 最后更新: 2020-01-25
控制流语句——循环条件关键字。
语法
Do While condition
[statement block]
Loop或
Do
[statement block]
Loop While condition或
While [condition]
[statement block]
Wend描述
While 指定当其后的 condition(条件)求值为真时,循环块将继续执行。此条件在每次循环迭代时检查。
示例
vb
Dim a As Integer
a = 0
Do While a < 10
Print "hello"
a = a + 1
Loop
'只要条件 (a < 10) 满足,此代码将持续在屏幕上打印 "hello"。与 QB 的区别
- 无。