Tukata Posted September 30, 2008 Posted September 30, 2008 I have this script and want to close the inputbox if "Cancel" is pressed. How do I do that ? $answer = InputBox("Test", "Enter a word", "Planet Earth", "", 200, 100) MsgBox(4096, "Test", $answer) While 1 Sleep(100) WEnd Thank you
Nahuel Posted September 30, 2008 Posted September 30, 2008 (edited) Add this below the InputBox line: If @error then exit -edit- And if that's all the code you have, no need for the loop. That'll only make it stay there for ever. Edited September 30, 2008 by Nahuel
DjDeep00 Posted September 30, 2008 Posted September 30, 2008 I have this script and want to close the inputbox if "Cancel" is pressed. How do I do that ? $answer = InputBox("Test", "Enter a word", "Planet Earth", "", 200, 100) MsgBox(4096, "Test", $answer) While 1 Sleep(100) WEnd Thank you If you want you can put that in a loop and exit when user cancels. While 1 $answer = InputBox("Test", "Enter a word", "Planet Earth", "", 200, 100) If @error then exit MsgBox(4096, "Test", $answer) WEnd
Tukata Posted September 30, 2008 Author Posted September 30, 2008 Many many thanks. That was what I needed. Tuk
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