Jump to content

How to Process multiple true Case statements?


stev379
 Share

Recommended Posts

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

Link to comment
Share on other sites

  • Developers

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

Link to comment
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.

Link to comment
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!

Link to comment
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
 Share

  • Recently Browsing   0 members

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