Sign in to follow this  
Followers 0
Geeky

Checkboxes!

3 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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.

 

Share this post


Link to post
Share on other sites

Im feeling very stupid right now...

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