这好办,例如:
dim i as integer
do while i<100
if checkpc=true then
i=101
else
sleep 1000 '等待一秒
i=i+1
endif
loop
'继续作下一步了,
dim i as integer
do while i<100
if checkpc=true then
i=101
else
sleep 1000 '等待一秒
i=i+1
endif
loop
'继续作下一步了,
dim i as integer
do while i<100
if checkpc=true then
i=101
else
sleep 1000 '等待一秒
i=i+1
if i>50 then '是大于50秒了
exit function
endif
endif
loop
'继续作下一步了,如果是上第一个程序始终执行的话,也可以利用时间控件处理.
On Error GoTo ShowErr
Dim TStart As Single
TStart = Timer
While (Timer - TStart) < (mSec / 1000)
DoEvents
Wend
Exit Sub
ShowErr:
MsgBox Err.Source & "------" & Err.Description
Exit SubEnd Sub
do
sleep 1000
loop until checkpc=true
http://www2.baidu.com/chains/chains.php?cn=cwwnet1 欢迎进入http://www2.baidu.com/chains/chains.php?cn=cwwnet1