Jump to content
Sign in to follow this  
Fran

Looping problem

Recommended Posts

I have a gui with this piece of code just before the "WEnd".

$ReadTHEME = GUICtrlRead($themeINPUT)
        $ReadSAMPLES = GUICtrlRead($samplesINPUT)
        If Not ($ReadTHEME = "" Or $ReadTHEME = "Theme Name" And $ReadSAMPLES = "" Or $ReadSAMPLES = "10001234,10001235,10001236") Then
            GUICtrlSetState($butDONEexe, $GUI_ENABLE)
        EndIf

It works great because the button is disabled while the input has not been changed. But the moment the user makes changes to both of the input boxes, $butDONEexe starts flickering and doesn't stop.

How can I only enable it once it doesn't keep looping and enabling the whole time?

F

Share this post


Link to post
Share on other sites

Add a variable when first action !

Dim $_var=1
$ReadTHEME = GUICtrlRead($themeINPUT)
        $ReadSAMPLES = GUICtrlRead($samplesINPUT)
        If $_var Then
            If Not ($ReadTHEME = "" Or $ReadTHEME = "Theme Name" And $ReadSAMPLES = "" Or $ReadSAMPLES = "10001234,10001235,10001236") Then
                GUICtrlSetState($butDONEexe, $GUI_ENABLE)
                $_var =0
            EndIf
        EndIf

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Dim $_var=1 must be outside your loop !

Well, now I feel like an idiot! Time to go home... no amount of coffee can rescue this day!

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...