下面一小段代码中,我感觉好像进入子程序后出不来,我本来想每一次循环开始都打印一句话,结果只是打了第一句cold reboot for:1 后就不打了,但是还是程序还在跑,请各位高手帮忙看看那里出了问题,谢谢!
#$language = "VBScript"
#$interface = "1.0"
Private Function Control(character)
' The following formula is useful:
' ASCIIControlCode = chr(asc(<UPPERCASE character>) - 64)
'
' For example, Ctrl + @ is really an ASCII 0, Ctrl + A is really an ASCII 1 (SOH),
' and so on
Control = chr(asc(character) - 64)
End Function
Private Sub ColdReboot
        a=j-i crt.Sleep 900000 crt.Sleep 1000
crt.Screen.Send vbCR
crt.Sleep 1000
crt.Screen.Send vbCR
crt.Screen.WaitForString "User name:"
crt.Screen.Send "root" & vbCR
crt.Sleep 1000
crt.Screen.Send vbCR crt.Screen.Send Control("A")
crt.Screen.WaitForString "Pass word:"
crt.Sleep 500
crt.Screen.Send "zxcv1234!" & vbCR
crt.Sleep 500
crt.Screen.Send "r" crt.Sleep 500
crt.Screen.Send "2"  crt.Sleep 500
crt.Screen.Send "y"
crt.Sleep 500
crt.Screen.Send "y" if crt.Screen.WaitForString ("The system is being cold reboot, please wait...",10)<>true then 
    TryAgain End if
End SubPrivate Sub TryAgain
 
crt.Sleep 500
crt.Screen.Send "x" crt.Sleep 500
crt.Screen.Send "y" crt.Sleep 60000
ColdReboot  
End SubSub Main   i=50
        j=i+1
  if i>0 then crt.Screen.Send "cold reboot for: " & j-i 
ColdReboot
i=i-1
  End if
End Sub