View Single Post
  #4  
Old 03-06-2018, 10:35 PM
bighalo bighalo is offline
Registered User
 
Join Date: Mar 2018
Posts: 4
#$language = "VBScript"
#$interface = "1.0"

g_vWaitFors = Array("Waiting for 1", "Waiting for 2")

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub Main()
Set objTab = crt.GetScriptTab

If objTab.Session.Connected <> True then
crt.Dialog.MessageBox _
Exit Sub
end if

objTab.Screen.Synchronous = true

Do
nIndex = objTab.Screen.WaitForStrings(g_vWaitFors)
if nIndex = 1 then
crt.Window.Activate
result = crt.Dialog.MessageBox("gotcha","gotcha", ICON_STOP Or BUTTON_OK Or DEFBUTTON1 )
if result = IDNO then
exit sub
end if
end if
Loop
End Sub

This is my code. After the script is running in loop. When the screen get the "WaitForStrings". The messagebox will be shown. If I click OK then exit sub. But the script is still running. I don't want the script running again. What I can do is "Script/Cancel menu" to end the script. Is there any easy way to end running script.
Reply With Quote