Sign in to follow this  
Followers 0
tworak

Input Box - Cancel

4 posts in this topic

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 - 4200

Sleep(1000)

$ref = InputBox("AutoLT", "Enter Sips Ref #", "", "")

; Now that the IFMS window is active type some text

; Make the IFMS window Active

WinActivate("IFMS -")

; Initial Comment

Send("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 - mrp

Send("s{ENTER}")

Send("Modem Swapped, Via Sips.{ENTER}Ref: ")

Send($ref)

Send("{F5}")

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Modified to

$ref = InputBox("AutoLT", "Enter Sips Ref #", "", "")

Select

Case @error = 1; The cancel button was pushed

Exit

EndSelect

And its all working perfect :think:

TY for the help

Edited by tworak

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0