stev379 Posted November 28, 2007 Posted November 28, 2007 What is the best practice... If I have multiple checkboxes, each assigned to a word and I want to check 4 of them for example, then click a button and add the 4 checked words to a list. Since only the first true Case statement is process, how can I code it to process all of the checked boxes, with one click of the button. Select Case $Ck_exeRD = ($GUI_CHECKED) Filewrite(etc....) Case $Ck_batRD = ($GUI_CHECKED) Filewrite(etc...) Case $Ck_vbsRD = ($GUI_CHECKED) Filewrite(etc...) Case $Ck_cmdRD = ($GUI_CHECKED) Filewrite(etc...) EndSelect Thanks for any help or suggestions!!
Developers Jos Posted November 28, 2007 Developers Posted November 28, 2007 I normally would use If-EndIf for each checkbox when they all need to be checked and possibly needs action. 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.
stev379 Posted November 28, 2007 Author Posted November 28, 2007 I normally would use If-EndIf for each checkbox when they all need to be checked and possibly needs action.JosThanks for the quick reply. I was once told if statements process a little slower than case statements. I really only have a total of 20 checkboxes with a potential to add more. Will the if statements process that much slower? I'm not looking for great speed, just no latency.
Richard Robertson Posted November 28, 2007 Posted November 28, 2007 It's not a noticeable difference in speed. The speed differences showed after several thousand loops of decisions. Just use If, it is just fine.
stev379 Posted November 28, 2007 Author Posted November 28, 2007 It's not a noticeable difference in speed. The speed differences showed after several thousand loops of decisions.Just use If, it is just fine.Good deal. I changed the Case statements to If's, and actually had to add a Sleep(500) within each If statement b\c it was processing too quickly to write to the file.Thanks for the info!
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