Jump to content

Recommended Posts

Posted (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 by Habland0
Posted

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.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...