Jump to content

Checkboxes!


Recommended Posts

I've got this script for moving files from one folder to another, and i wanted to know how i can make a script that checks what files are checked, and if they are, then move it to the right directory. But it keeps saying that there is Endselect but not Select, why?

GUICreate ( "Checkbox" , 300 , 200 , -1 , -1 )
GUISetBKColor (0xFFFFAA)
$cb1 = GUICtrlCreateCheckbox ("CHECKBOX 1", 10, 10, 120, 20)
$cb2 = GUICtrlCreateCheckbox ("CHECKBOX 2", 10, 40, 120, 20)
$button = GUICtrlCreateButton ("Check", 60, 80, 200, 20)





While 1

    $msg = GUIGetMsg()

    
    Select 
        case $msg = $button

            If $cb2 = $GUI_CHECKED Then
                DirCopy("1", "dest", 1)
            If $cb1 = $GUI_CHECKED Then
                DirCopy("2", "dest", 1)
    
    Endselect
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend
Link to comment
Share on other sites

I've got this script for moving files from one folder to another, and i wanted to know how i can make a script that checks what files are checked, and if they are, then move it to the right directory. But it keeps saying that there is Endselect but not Select, why?

GUICreate ( "Checkbox" , 300 , 200 , -1 , -1 )
GUISetBKColor (0xFFFFAA)
$cb1 = GUICtrlCreateCheckbox ("CHECKBOX 1", 10, 10, 120, 20)
$cb2 = GUICtrlCreateCheckbox ("CHECKBOX 2", 10, 40, 120, 20)
$button = GUICtrlCreateButton ("Check", 60, 80, 200, 20)
While 1

    $msg = GUIGetMsg()

    
    Select 
        case $msg = $button

            If $cb2 = $GUI_CHECKED Then
                DirCopy("1", "dest", 1)
            If $cb1 = $GUI_CHECKED Then
                DirCopy("2", "dest", 1)
    
    Endselect
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend
Didn't close your if statements

If $cb2 = $GUI_CHECKED Then
                DirCopy("1", "dest", 1)
                                                endif
            If $cb1 = $GUI_CHECKED Then
                DirCopy("2", "dest", 1)
                                                endif
Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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