Sign in to follow this  
Followers 0
stev379

How to Process multiple true Case statements?

5 posts in this topic

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!!

Share this post


Link to post
Share on other sites



I normally would use If-EndIf for each checkbox when they all need to be checked and possibly needs action.

Jos

Thanks 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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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!

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