Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted

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!

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...