Fossil Rock Posted March 8, 2006 Share Posted March 8, 2006 (edited) I use a primary Select...Case...EndSelect with 8 choices (which have a secondary Select...Case...EndSelect, this seems to run pretty fast. I added an If...Then before each primary Case which checks to see if it should run or not via 8 radio buttons (user can select what they want to run or not). The speed went straight to pot. Is there a better (faster) way of checking via the radio buttons whether it should run or not?Example:Select Case If GUICtrlRead($Checkbox1) = 1 Then Select Case Case Case EndSelect Case If GUICtrlRead($Checkbox2) = 1 Then Select Case Case Case Case EndSelect Case If GUICtrlRead($Checkbox3) = 1 Then Select Case Case EndSelect EndSelect Edited March 8, 2006 by Fossil Rock Agreement is not necessary - thinking for one's self is! Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 8, 2006 Share Posted March 8, 2006 I use a primary Select...Case...EndSelect with 8 choices (which have a secondary Select...Case...EndSelect, this seems to run pretty fast. I added an If...Then before each primary Case which checks to see if it should run or not via 8 radio buttons (user can select what they want to run or not). The speed went straight to pot. Is there a better (faster) way of checking via the radio buttons whether it should run or not? Example: Select Case If GUICtrlRead($Checkbox1) = 1 Then Select Case Case Case EndSelect Case If GUICtrlRead($Checkbox2) = 1 Then Select Case Case Case Case EndSelect Case If GUICtrlRead($Checkbox3) = 1 Then Select Case Case EndSelect EndSelect You left off EndIf's and the conditions for the Case lines, but I assume you meant that to be a stripped down example, and they are there in your code. If there is only one 'If' per 'Case' you could use 'And' to put the conditions together and see if that speeds things up: Select Case $a = $b And GUICtrlRead($Checkbox1) = 1 Select Case Case Case EndSelect Case $c = $d And GUICtrlRead($Checkbox2) = 1 Select Case Case Case Case EndSelect Case $e = $f And GUICtrlRead($Checkbox3) = 1 Select Case Case EndSelect EndSelect If the delay comes from the time it takes to do Windows inter-process messaging, this won't buy you anything. Hope it helps. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Fossil Rock Posted March 8, 2006 Author Share Posted March 8, 2006 First run seems to be faster, almost back to normal. Thanks Agreement is not necessary - thinking for one's self is! 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