TheDcoder Posted April 7, 2015 Share Posted April 7, 2015 (edited) Hello, Please look at the code: ; As always, this is a decoy script ;) Global $sNum = Random(1, 4, 1) & "E" Switch $sNum Case "1E" And "2E" MsgBox(64, "TEST", "1E or 2E") Case "3E" And "4E" MsgBox(64, "TEST", "3E or 4E") EndSwitch MsgBox(64, "TEST", "The number was: " & $sNum) If $sNum = 1E or 2E it works, but when $sNum = 3E or 4E it shows the MsgBox for 1st Case How can I get it to work? Thanks In Advance TD Edited April 7, 2015 by TheDcoder EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
Solution Valuater Posted April 7, 2015 Solution Share Posted April 7, 2015 Remove the "And" Global $sNum = Random(1, 4, 1) & "E" Switch $sNum Case "1E","2E" MsgBox(64, "TEST", "1E or 2E") Case "3E", "4E" MsgBox(64, "TEST", "3E or 4E") EndSwitch MsgBox(64, "TEST", "The number was: " & $sNum) TheDcoder 1 Link to comment Share on other sites More sharing options...
water Posted April 7, 2015 Share Posted April 7, 2015 $sNum = 1E or 2E You correctly describe what you want, but code something different. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
TheDcoder Posted April 7, 2015 Author Share Posted April 7, 2015 (edited) Thanks Valuater P.S Comma in programming languages?, thats something new for for me Edited April 7, 2015 by TheDcoder EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
water Posted April 7, 2015 Share Posted April 7, 2015 Why new, have a look at the help file! My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
TheDcoder Posted April 7, 2015 Author Share Posted April 7, 2015 @water EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion 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