Sign in to follow this  
Followers 0
rvbfreak

Checkboxes

4 posts in this topic

This is a really easy question to answer probably, but how do i check if a checkbox is checked? (No, the alliteration was not on purpose :mellow:)

i need to use it in an 'If' statement

thanks

-rj

Share this post


Link to post
Share on other sites

From the helpfile for GUICtrlRead.

For Checkbox, Radio control several states can be returned as $GUI_FOCUS and $GUI_CHECKED,. So use i.e. BitAnd(GUICtrlRead($Item),$GUI_CHECKED) to test if the control is checked.


GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF.

Share this post


Link to post
Share on other sites

From the helpfile for GUICtrlRead.

alirght, thanks. i didnt know how to compare the variables.

this is off topic, but now autoit keeps complaining about something that does not make sense. it says ]

(108) : ==> "If" statement has no matching "EndIf" statement.:

EndFunc

heres the code im having problems with:

Func button1()
$going=1
guictrlsetdata($status,"Running")
$count=1
$current=0
    if BITAND(guictrlread($check1),$GUI_UNCHECKED) then
Do      
            $read=guictrlread($input1)
            $delay=guictrlread($input3)
            $curprox = _GUICTRLEDIT_GETLINE($input2, $current)
            RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable", "REG_DWORD", "1")
            RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer", "REG_SZ",$curprox)
            $objWMIService2 = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\CIMV2\Applications\MicrosoftIE") 
            $colIESettings3 = $objWMIService2.ExecQuery ("Select * from MicrosoftIE_LANSettings")
            $nie=_IECreate($read)
            _IELinkClickByIndex($nie,0)
            sleep($delay)
            if $current = $count Then
            $current=1
                else
            $current = $current + 1
            endif
            If processexists("IEXPLORE.exe") then
            processclose("IEXPLORE.exe")
            endif
        
    Until $going=0
    EndIf
    if BitAND(Guictrlread($check2),$GUICHECKED) Then
    $npc=0
    Do      
            $read=guictrlread($input1)
            $delay=guictrlread($input3)
            $curprox = _GUICTRLEDIT_GETLINE($input2, $current)
            RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable", "REG_DWORD", "1")
            RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer", "REG_SZ",$curprox)
            $objWMIService2 = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\CIMV2\Applications\MicrosoftIE") 
            $colIESettings3 = $objWMIService2.ExecQuery ("Select * from MicrosoftIE_LANSettings")
            $nie=_IECreate($read)
            _IELinkClickByIndex($nie,0)
            sleep($delay)
            if $npc=20 then
            if $current = $count Then
            $current=1
            $npc=0
                else
            $current = $current + 1
            $npc=0
        endif
        endif
            If processexists("IEXPLORE.exe") then
            processclose("IEXPLORE.exe")
            endif
        $npc=$npc + 1
    Until $going=0  
    EndFunc

i dont get why it keeps saying the if statement has no matching endif statement.

Share this post


Link to post
Share on other sites

Paste that into SciTE and hit CTRL-t (run Tidy) and it will show you exactly where the problem is...

:mellow:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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