Habland0 Posted August 12, 2010 Posted August 12, 2010 (edited) What is the most efficient manner of flipping a bool? Here is the shortest way I can think of: If $bool Then $bool = False Else $bool = True EndIf However some programming languages allow: $bool = !$bool (i.e. True = Not True, False = Not False) Is anything like this single line approach possible in AutoIt? Edited August 12, 2010 by Habland0
omikron48 Posted August 12, 2010 Posted August 12, 2010 $bool = Not $bool Next time, spend some time reading the help file, specially the Language Reference section.
Habland0 Posted August 12, 2010 Author Posted August 12, 2010 Next time, spend some time reading the help file, specially the Language Reference section.I was reading that section this afternoon. It must have completely slipped my gaze, because I don't recall reading anything about dealing with booleans. I just looked it up again and found it immediately - thank you.
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