nikink Posted September 14, 2006 Posted September 14, 2006 Using v3.2.0.1 $var = 30 Switch Int($var) Case 1 To 10 MsgBox(0, "Example", "$var was greater than 1") Case 11 To 20 MsgBox(0, "Example", "$var was greater than 10") Case 21 To 30 MsgBox(0, "Example", "$var was greater than 20") Case 31 To 40 MsgBox(0, "Example", "$var was greater than 30") Else Case MsgBox(0, "Example", "$var was greater than 40 or less r equal to 0") EndSwitch Errors out with: C:\Documents and Settings\nmay\Desktop\Switch-test.au3(16,6) : ERROR: missing EndSwitch. Else ~~~~~^ C:\Documents and Settings\nmay\Desktop\Switch-test.au3(3,17) : REF: missing EndSwitch. Switch Int($var) ~~~~~~~~~~~~~~~~^ C:\Documents and Settings\nmay\Desktop\Switch-test.au3(16,6) : ERROR: syntax error Else ~~~~~^ C:\Documents and Settings\nmay\Desktop\Switch-test.au3 - 2 error(s), 0 warning(s) And that example is copy pasted straight from help files... What am I missing?
GaryFrost Posted September 14, 2006 Posted September 14, 2006 Case Else SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
nikink Posted September 14, 2006 Author Posted September 14, 2006 Case Else Ah! Something so simple! Thanks. How do I notify the folks in charge of the helpfile?
GaryFrost Posted September 14, 2006 Posted September 14, 2006 Ah! Something so simple! Thanks. How do I notify the folks in charge of the helpfile? why? here's the example from the help file: Switch @HOUR Case 6 To 11 $msg = "Good Morning" Case 12 To 17 $msg = "Good Afternoon" Case 18 To 21 $msg = "Good Evening" Case Else $msg = "What are you still doing up?" EndSwitch MsgBox(0, Default, $msg) SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
nikink Posted September 14, 2006 Author Posted September 14, 2006 Oops, there see, I am really dumb - I meant the On-Line reference:http://www.autoitscript.com/autoit3/docs/i...conditional.htmWhich is where I got my example above from. B-)
GaryFrost Posted September 14, 2006 Posted September 14, 2006 I see the example from http://www.autoitscript.com/autoit3/docs/keywords/Switch.htm is correctPost it in bug reports as a documention correction SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
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