telco1800 Posted October 12, 2005 Share Posted October 12, 2005 Okay, I just downloaded autoit. I'm a light programmer, but mostly networking and phonesystem speciallist. I love what I've seen so far of autoit, and I'm definately going to donate to the maker. However I've looked through the help, and I haven't found how to deal with the results of a msgbox. so say I use... MsgBox(4, "whatever", "Do you want to install?") How do I interperet the results. The help file has what the result codes are, but no example of using the result code. So if I wanted to do something like if result = 6 then continue, else end. How would I do that, what would the sytax look like? Thank you everyone in advance, and I'm sorry if I duplicated a previous post, but I couldn't find it. Telco1800 Link to comment Share on other sites More sharing options...
w0uter Posted October 12, 2005 Share Posted October 12, 2005 (edited) $i_output = Msgbox() if $i_output = 6 Then ;do whatever EndIf *edit: im sorry Edited October 12, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
herewasplato Posted October 12, 2005 Share Posted October 12, 2005 (edited) $ans = MsgBox(3, "AutoIt", "Yes - No - Cancel") If $ans = 6 Then $var = "YES" ;yes If $ans = 7 Then $var = "NO" ;no If $ans = 2 Then Exit ;cancel MsgBox(0, "AutoIt",$ans) Edit: like I had a chance... Edited October 12, 2005 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
falconv Posted October 12, 2005 Share Posted October 12, 2005 I'm a personal fan of Select over If Then statements, so taking herewasplato's example: $ans = MsgBox(3,"AutoIt","Yes - No - Cancel") Select Case $ans = 6 $var = "YES" Case $ans = 7 $var = "NO" Case $ans = 2 Exit EndSelect MsgBox(0,"AutoIt",$ans)They both work though. Link to comment Share on other sites More sharing options...
w0uter Posted October 12, 2005 Share Posted October 12, 2005 i prefere switch over select in this case My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
telco1800 Posted October 12, 2005 Author Share Posted October 12, 2005 Thank you guys so much, your the heros for the day. lol Link to comment Share on other sites More sharing options...
falconv Posted October 12, 2005 Share Posted October 12, 2005 Apologies for hijacking the thread, but W0uter, can you explain Switch to me (or perhaps send me a PM explaining it)? I tried to look it up in the Help file, but couldn't find it. Is it the same syntax as Select (Switch, Case, Case, Case Else, EndSwitch)? Link to comment Share on other sites More sharing options...
w0uter Posted October 12, 2005 Share Posted October 12, 2005 (edited) switch is BETA only. your code is 130 chars (w/o spaces) with switch it could be 110 chars also switch is a bit faster. Switch MsgBox(3, "AutoIt", "Yes - No - Cancel") Case 6 $var = "YES" Case 7 $var = "NO" Case 2 Exit EndSwitch MsgBox(0, "AutoIt", $ans) Edited October 12, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
jefhal Posted October 12, 2005 Share Posted October 12, 2005 I tried to look it up in the Help file, but couldn't find it.Keyword ReferenceSwitch...Case...EndSwitch Look in the beta helpfile... ...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format Link to comment Share on other sites More sharing options...
falconv Posted October 12, 2005 Share Posted October 12, 2005 Ah, that's why, I wasn't looking in the beta help file Thanks! I'll start giving it a shot in my scripts. 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