Jump to content

[Solved]_If then Variable Q


Recommended Posts

Shouldnt this write to console only once? Instead it keeps on writing to console Hidden,Hidden,Hidden..etc.

$btn1_ADD_state = 'Visible'

    While 1
        Sleep(1000)

        If $btn1_ADD_state = 'Visible' Then         
            $btn_ADD_state = 'Hidden'
            ConsoleWrite($btn_ADD_state & @CRLF)
        EndIf
    WEnd

Edit Thanx Verox

Edited by goldenix
My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]
Link to comment
Share on other sites

Shouldnt this write to console only once? Instead it keeps on writing to console Hidden,Hidden,Hidden..etc.

$btn1_ADD_state = 'Visible'

    While 1
        Sleep(1000)

        If $btn1_ADD_state = 'Visible' Then         
            $btn_ADD_state = 'Hidden'
            ConsoleWrite($btn_ADD_state & @CRLF)
        EndIf
    WEnd
It's doing what you told it to do. Your setting the state back to hidden after checking it's visible.
Link to comment
Share on other sites

That sends it to console every second try this:

$btn1_ADD_state = 'Visible'
$sendedstat = "false"

While 1
    Sleep(1000)
    If $btn1_ADD_state = 'Visible' Then
        $btn_ADD_state = 'Hidden'
        If $sendedstat == "false" Then
            $sendedstat = "true"
            ConsoleWrite($btn_ADD_state & @CRLF)
        EndIf
    EndIf
WEnd

edited the code... now it works and just sends 1x hidden

sorry i forgot sdomething in there

Edited by Verox743

Started with AutoIt on 12th June, 2008.

Link to comment
Share on other sites

nope thats no bug

look at your second code at the

$btn_ADD_state = 'Hidden'

ConsoleWrite($btn_ADD_state & @CRLF)

you forgot the 1s

at the end of $btn

it should be

$btn1_ADD_state = 'Hidden'

ConsoleWrite($btn1_ADD_state & @CRLF)

Started with AutoIt on 12th June, 2008.

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