d2a007 Posted August 16, 2005 Share Posted August 16, 2005 Hi guys, I was reading through the help file and working on a GUI for a small program I made. I wanted the ability to pause the script and check the status. I looked up pause in the help file and found this little bit of code(slightly changed for my use). My question is after mulling around with this for a bit and searching the forum/help file I can't seem to figure out what it is doing. I'm new to AutoIt so I borrow alot of code from the forums and the help file then break it down line by line and put notes about what that line of code is doing to learn the way things work. Currently this code works perfect and I have a button and the key linked to it, I just don't understand what it's doing. ;Pause function Func TogglePause() ;No clue $Paused = NOT $Paused ;Lost here too While $Paused ;1/10th second pause in the loop sleep(100) ;Place a tooltip stating the script is paused at my preset location based on res ToolTip('Script is "Paused"',$placeGui,0) ;Start loop over WEnd ;Set tooltip to nothing ToolTip("") ;End function EndFunc Any info would be great! Thanks d2a007 Link to comment Share on other sites More sharing options...
w0uter Posted August 16, 2005 Share Posted August 16, 2005 begin $paused = True function changes $paused to False (false = NOT TRUE) function changes $paused to True (true = NOT FALSE) Sript gets stuck in the loop while $paused = True function changes $paused to False Script gets out of the loop. hope you understand me. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
seandisanti Posted August 16, 2005 Share Posted August 16, 2005 (edited) Hi guys, I was reading through the help file and working on a GUI for a small program I made. I wanted the ability to pause the script and check the status. I looked up pause in the help file and found this little bit of code(slightly changed for my use). My question is after mulling around with this for a bit and searching the forum/help file I can't seem to figure out what it is doing. I'm new to AutoIt so I borrow alot of code from the forums and the help file then break it down line by line and put notes about what that line of code is doing to learn the way things work. Currently this code works perfect and I have a button and the key linked to it, I just don't understand what it's doing.;Pause function Func TogglePause() ;No clue $Paused = NOT $Paused ;Lost here too While $Paused ;1/10th second pause in the loop sleep(100) ;Place a tooltip stating the script is paused at my preset location based on res ToolTip('Script is "Paused"',$placeGui,0) ;Start loop over WEnd ;Set tooltip to nothing ToolTip("") ;End function EndFuncAny info would be great! Thanksd2a007<{POST_SNAPBACK}>NOT Logical NOT operation. e.g. NOT 1 (equals 0)it's like a switch. whatever you're using it on is assumed to be true, so it returns a value that would make it false.examples:$ex = NOT 1 (0)$ex = NOT 0 (1)hm... this is turning out to be a more akward explanation than i thought. basically it returns a value that makes the expression it's operating on evaluate to false.if TRUE and FALSE were key words in AutoIT, simple explanation is:$ex = NOT TRUE (duh)$ex = NOT FALSE (i know you see the pattern)***edit***apparently forgot english for a minute... i think i repaired that.... Edited August 16, 2005 by cameronsdad Link to comment Share on other sites More sharing options...
Josbe Posted August 16, 2005 Share Posted August 16, 2005 To illustrate the explanation, you could add these tooltips: ;... ;;;; Body of program would go here;;;; While 1 Sleep(100) ToolTip("$Paused = " & $Paused ) WEnd ;;;;;;;; Func TogglePause() ToolTip("$Paused = " & $Paused ) Sleep(500) $Paused = NOT $Paused While $Paused sleep(100) ;ToolTip('Script is "Paused"', 0, 0) ToolTip("$Paused = " & $Paused & " (paused)") WEnd ;ToolTip("") EndFunc ;... AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
w0uter Posted August 16, 2005 Share Posted August 16, 2005 OT:if TRUE and FALSE were key words in AutoIT<{POST_SNAPBACK}>there are. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
seandisanti Posted August 16, 2005 Share Posted August 16, 2005 OT:there are.<{POST_SNAPBACK}>i think i've messed up some detail in every single post today...on the bright side, i'm learning alot from you guys correcting me Link to comment Share on other sites More sharing options...
d2a007 Posted August 16, 2005 Author Share Posted August 16, 2005 Thanks a ton guys. I read through the help guide and didn't seem to come up with anything but when I just went back to it i have a feeling that "NOT" is used as a term in the search functions, ie Sun NOT computer = The big light outside. Well I'm back to making a mess out of my program, thanks again all! d2a007 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now