Sign in to follow this  
Followers 0
Fossil Rock

Select...Case...EndSelect question

3 posts in this topic

#1 ·  Posted (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 by Fossil Rock

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Share this post


Link to post
Share on other sites



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. :o


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

Share this post


Link to post
Share on other sites

First run seems to be faster, almost back to normal.

Thanks


Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0