Option Explicit
Dim i As Integer
Dim sum As Integer
Private Sub Command1_Click()
Cls
Font.Size = 70
End Sub
Private Sub Timer1_Timer()
sum = sum + i
i = i + 1
If i > 100 Then
Me.Timer1.Enabled = False
Print sum
Print "timer's i=" & i
End If
End Sub
VBScript计数器示例
本文介绍了一个使用VBScript实现的简单计数器程序。该程序通过定时器每秒递增一个数值,并在达到100后停止计数并显示最终结果。此示例有助于理解VBScript的基本语法及定时器的用法。
1882

被折叠的 条评论
为什么被折叠?



