hrabikk Posted July 20, 2013 Share Posted July 20, 2013 Hello I got a question. Is there any other way to do Select function: We got 5 different vars: $1=true or false, $2=true or false and $3=true or fallse And now the select function Select Case $1=true and $2=true and $3=true ..do something.. Case $1=false and $2=false and $3=false ..do something.. So with three variables we need to write 8 different combinations. Thats not really hard, but when we got 8 different variables we need to make 256 Cases. Is there any easier way to do such a thing? Like for example: Case $1=true and ($2=True or False) Any ideas? Link to comment Share on other sites More sharing options...
Developers Jos Posted July 20, 2013 Developers Share Posted July 20, 2013 (edited) You first need to answer the question how many Case statements you would have for the 256 different options? So tell us what you want to do for each case you identify. This statement " Case $1=true and ($2=True or False)" doesn make much sense as examples since that is the same as "Case $1=true". Edited July 20, 2013 by 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...
water Posted July 20, 2013 Share Posted July 20, 2013 (edited) As each variable can only have 2 states (True or False) checking for both of them can be dropped. Means: Case $1=true and ($2=True or False) is equivalent to Case $1=true Edit: Jos was faster! Edited July 20, 2013 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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