Jump to content

Script Help


liten
 Share

Recommended Posts

Func Control() 
    Local $Checkbox1
    
    $Checkbox1 = GUICtrlCreateCheckbox("checkbox1", 87, 216, 17, 17, -1, BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))
    GUICtrlSetBkColor(-1, 0xA0A0A4)
    
 While 1
    $msg = GuiGetMsg()
    $Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Checkbox1
        If GUICtrlRead($Box1) = $GUI_CHECKED Then
            GUICtrlSetState($Slider2, $GUI_DISABLE)
            GUICtrlSetState($Slider1, $GUI_DISABLE)
            GUICtrlSetState($Button2, $GUI_ENABLE) 
            GUICtrlSetState($Button3, $GUI_ENABLE)
            GUICtrlSetState($Button4, $GUI_ENABLE)
            GUICtrlSetState($Button5, $GUI_ENABLE)
        If GUICtrlRead($Box1) = $GUI_UNCHECKED Then
            GUICtrlSetState($Slider2, $GUI_ENABLE)
            GUICtrlSetState($Slider1, $GUI_ENABLE)
            GUICtrlSetState($Button2, $GUI_DISABLE) 
            GUICtrlSetState($Button3, $GUI_DISABLE)
            GUICtrlSetState($Button4, $GUI_DISABLE)
            GUICtrlSetState($Button5, $GUI_DISABLE)
        EndIf
    EndSwitch
 WEnd
 EndFunc

No matter how i change it i am always getting silly errors, such as no WEnd when it is right their, Can anybody help please, point out any mistaekes

TY in advance

My UDF:Freeze.au3-Freeze values like CE, ML, ETC[i][/i][u][/u]

Link to comment
Share on other sites

If BitAnd(GUICtrlRead($Box1), $GUI_CHECKED) = $GUI_CHECKED Then
            GUICtrlSetState($Slider2, $GUI_DISABLE)
            GUICtrlSetState($Slider1, $GUI_DISABLE)
            GUICtrlSetState($Button2, $GUI_ENABLE) 
            GUICtrlSetState($Button3, $GUI_ENABLE)
            GUICtrlSetState($Button4, $GUI_ENABLE)
            GUICtrlSetState($Button5, $GUI_ENABLE)
        Else
            GUICtrlSetState($Slider2, $GUI_ENABLE)
            GUICtrlSetState($Slider1, $GUI_ENABLE)
            GUICtrlSetState($Button2, $GUI_DISABLE) 
            GUICtrlSetState($Button3, $GUI_DISABLE)
            GUICtrlSetState($Button4, $GUI_DISABLE)
            GUICtrlSetState($Button5, $GUI_DISABLE)
        EndIf

try that...

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Link to comment
Share on other sites

For Future reference your errors were caused by

If GUICtrlRead($Box1) = $GUI_CHECKED Then
            GUICtrlSetState($Slider2, $GUI_DISABLE)
            GUICtrlSetState($Slider1, $GUI_DISABLE)
            GUICtrlSetState($Button2, $GUI_ENABLE) 
            GUICtrlSetState($Button3, $GUI_ENABLE)
            GUICtrlSetState($Button4, $GUI_ENABLE)
            GUICtrlSetState($Button5, $GUI_ENABLE)
        If GUICtrlRead($Box1) = $GUI_UNCHECKED Then
            GUICtrlSetState($Slider2, $GUI_ENABLE)
            GUICtrlSetState($Slider1, $GUI_ENABLE)
            GUICtrlSetState($Button2, $GUI_DISABLE) 
            GUICtrlSetState($Button3, $GUI_DISABLE)
            GUICtrlSetState($Button4, $GUI_DISABLE)
            GUICtrlSetState($Button5, $GUI_DISABLE)
        EndIf

It should have been written using Else or ElseIf instead of the second If Statement. The other option would have been to close off the first If with an EndIf.

billthecreator has given you the proper code. When you see an error reported as Missing WEnd or Missing EndFunc etc. and you can clearly see that the Missing line is there, look before the indicated line for the actual bad code.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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