5 |
Case 1: |
6 |
MsgBox(9999) |
7 |
Case Else |
8 |
MsgBox( "输入不合法!" ) |
9 |
End Select |
8. 循环语句
VBScript中可以使用以下循环语句:
Do...Loop语句
While...Wend语句
For...Next语句
For Each...Next语句
8.1. Do…Loop语句
当(或直到)条件为True时循环,语法结构如下:
当条件为True时重复执行某语句块。
view sourceprint?
1 |
Do [{ While | Until } condition] |
2 |
[statements] |
3 |
[ Exit Do ] |
4 |
[statements] |
5 |
Loop |
当条件变为True之前重复执行某语句块。
view sourceprint?
1 |
Do |
2 |
[statements] |
3 |
[ Exit Do ] |