Jump to content

Check if NOT paused?


mwpeck
 Share

Recommended Posts

Basically I have a standard pause function:

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
    WEnd
EndFunc

How I can negate that loop so I can check if its NOT paused? I have tried:

Func TogglePause()
    $Paused = NOT $Paused
    While <> $Paused
        sleep(100)
    WEnd
EndFunc

But it doesnt work just says "==> Error in expression.:"

Edited by mwpeck
Link to comment
Share on other sites

Look at upper left corner.

Global $Paused

HotKeySet("{PAUSE}", "TogglePause")

While 1
    Sleep(100)
    ToolTip('Script is NOT "Paused"',0,0)
WEnd

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        Sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
EndFunc
Link to comment
Share on other sites

Look at upper left corner.

What do you mean? I already have the variable set as a global variable....basically what I'm trying to do, is use it in another function. The other function is basically an infinite loop on its own, I want to be able to exit the function when I push the pause button. Therefore I want it to loop WHILE its NOT paused.

EDIT:

Hmmm, nevermind, it seems:

While NOT $Paused

sleep(100)

WEnd

worked...guess you have to use NOT in place of <> for booleans or something. Edited by mwpeck
Link to comment
Share on other sites

What do you mean? I already have the variable set as a global variable....basically what I'm trying to do, is use it in another function. The other function is basically an infinite loop on its own, I want to be able to exit the function when I push the pause button. Therefore I want it to loop WHILE its NOT paused.

EDIT:

Hmmm, nevermind, it seems:

worked...guess you have to use NOT in place of <> for booleans or something.

<> is for comparison so when you use this you shoud compare the var with something like

while $var<>true;($var=false)
while $var;($var=true)
while not $var;($var=false)
while not $var=false;($var=true)
etc ... etc... Edited by TheMadman

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

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