TerarinK Posted April 5, 2009 Share Posted April 5, 2009 $iQuestion = MsgBox(4, "Title", "Question", 10) Switch $iQuestion Case 7 MsgBox(0, "Title", "No was pressed", 3) Case Else MsgBox(0, "Title", "Yes was selected, proceeding", 3) EndSwitch 0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E Link to comment Share on other sites More sharing options...
aphesia Posted April 5, 2009 Author Share Posted April 5, 2009 finally works.. thanks alot Link to comment Share on other sites More sharing options...
TerarinK Posted April 5, 2009 Share Posted April 5, 2009 Switch MsgBox(4, "Title!", "Run it?", 10) if Case 6 Then Exit EndIf ;Yes was pressed if Case 7 Then Exit EndIf ;No was pressed Case -1 ;Timed out EndSwitch switch that to this: Switch MsgBox(4, "Title!", "Run it?", 10) Case 6 Then Exit EndIf ;Yes was pressed Case 7 Then Exit EndIf ;No was pressed Case -1 ;Timed out EndSwitch You have a flaw in your code as well as the other code. It was said "how can i make a msgbox which asks for yes & no and if i click no , it does smth.. if nothing happens after 10 secs it will automatically press yes". So you need to just select the "Yes" which is 6 and write code for it but then you need to also allow for the timeout, the only way I know how to do that without writing two of the same thing would be to only allow the 7, "No" to exit the script and either the 6 or -1 for Timeout to proceed Also your following the case statement with rements of the If which is incorrect all Case statement should be just worried about the statement on the switch, read the help file on Switch (do note that switch is the fastest because you could do it in a Select or If ElseIf Else statement 0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E Link to comment Share on other sites More sharing options...
GEOSoft Posted April 5, 2009 Share Posted April 5, 2009 (edited) You have a flaw in your code as well as the other code. It was said "how can i make a msgbox which asks for yes & no and if i click no , it does smth.. if nothing happens after 10 secs it will automatically press yes". So you need to just select the "Yes" which is 6 and write code for it but then you need to also allow for the timeout, the only way I know how to do that without writing two of the same thing would be to only allow the 7, "No" to exit the script and either the 6 or -1 for Timeout to proceed Also your following the case statement with rements of the If which is incorrect all Case statement should be just worried about the statement on the switch, read the help file on Switch (do note that switch is the fastest because you could do it in a Select or If ElseIf Else statementThere sure is. You don't use Then in a Case statement Case 6 Then should be Case 6The same applies to the others. Edited April 5, 2009 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Developers Jos Posted April 5, 2009 Developers Share Posted April 5, 2009 Ok, for the last time: The initial response given by Paulie was correct so... USE IT ! Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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