VBScript代码示例 - Do Loop While 循环语句

来源:岁月联盟 编辑:exp 时间:2008-11-22

<html>
<head><title>VBScript代码示例 - Do Loop While 循环语句</title></head>
<body>
<script type="text/vbscript">
Sub ChkLastWhile()
Dim counter, myNum
counter = 0
myNum = 9
Do
myNum = myNum - 1
counter = counter + 1
Loop While myNum > 10
MsgBox "循环重复了 " & counter & " 次。"
End Sub
Call ChkLastWhile
</script>
</body>
</html>

  编辑文本后显示结果:

VBScript代码示例 - Do Loop While 循环语句