tworak Posted May 1, 2006 Share Posted May 1, 2006 hi,Ive looked all through the manual and various posts but cant see a definate way of making use of the cancel button on an input box.Basically when the cancel button is hit on the inputbox id like the script to stop execution al together.heres my current code i would appreciate any help; AUTO clear / close from open - 4200Sleep(1000)$ref = InputBox("AutoLT", "Enter Sips Ref #", "", ""); Now that the IFMS window is active type some text; Make the IFMS window ActiveWinActivate("IFMS -"); Initial CommentSend("c{ENTER}{ENTER}{ENTER}")Send("Modem Found to be Faulty")Send("{F5}")Sleep(1000); Clear the ticket and close the ticket - with codes: opt - ds2 - h/w - mrpSend("s{ENTER}")Send("Modem Swapped, Via Sips.{ENTER}Ref: ")Send($ref)Send("{F5}") Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted May 1, 2006 Share Posted May 1, 2006 if u get the @error u can check if it does so heres what it would look like $ref = InputBox("AutoLT", "Enter Sips Ref #", "", "") if @error = 1 Then Exit Else WinActivate("IFMS -") Send("c{ENTER}{ENTER}{ENTER}") Send("Modem Found to be Faulty") Send("{F5}") Sleep(1000) Send("s{ENTER}") Send("Modem Swapped, Via Sips.{ENTER}Ref: ") Send($ref) Send("{F5}") EndIf Link to comment Share on other sites More sharing options...
tworak Posted May 1, 2006 Author Share Posted May 1, 2006 (edited) Modified to$ref = InputBox("AutoLT", "Enter Sips Ref #", "", "")Select Case @error = 1; The cancel button was pushed ExitEndSelectAnd its all working perfect TY for the help Edited May 1, 2006 by tworak Link to comment Share on other sites More sharing options...
Knight Posted May 1, 2006 Share Posted May 1, 2006 Return Value Success: Returns the string that was entered. Failure: Returns an empty string and sets @error as follows: @Error 0 = The string returned is valid. 1 = The Cancel button was pushed. 2 = The Timeout time was reached. 3 = The InputBox failed to open. This is usually caused by bad arguments. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now