这好办,例如:
dim i as integer
do while i<100
    if checkpc=true then
        i=101
    else
         sleep 1000  '等待一秒
         i=i+1
    endif
    
loop
'继续作下一步了,

解决方案 »

  1.   

    这好办,例如:
    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
    '继续作下一步了,如果是上第一个程序始终执行的话,也可以利用时间控件处理.
      

  2.   

    以下函数优于 SLEEP  函数(因为 SLEEP 会让你的进程挂起):Public Sub Delay(mSec As Long)
        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
      

  3.   


    do 
    sleep 1000
    loop until checkpc=true
      

  4.   

    使用TIMER 控件
    http://www2.baidu.com/chains/chains.php?cn=cwwnet1                  欢迎进入http://www2.baidu.com/chains/chains.php?cn=cwwnet1
      

  5.   

    timer应该更简单一些吧,计算时把mouse换成漏斗状