Sign in to follow this  
Followers 0
d2a007

Question about "NOT"

7 posts in this topic

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

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

#3 ·  Posted (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
EndFunc

Any info would be great!

Thanks

d2a007

<{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 by cameronsdad

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 :whistle:

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

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

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