Sign in to follow this  
Followers 0
mwpeck

Check if NOT paused?

4 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

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