Jump to content

True and False not for use in expressions


Recommended Posts

The help for True and False says: "These keywords should not be used in expressions as AutoIt will not detect this 'misuse' and the results will be unpredictable". What precisely is meant by this?

The example is:

$bool= False

if NOT $bool = true Then Msgbox(0,"Bool comparison", "OK")

Isn't $bool = true an expression?

Or is the help saying that

CODE
if FileCopy("C:\old\*.*", "C:\new\") = True then
won't work because FileCopy() returns 1 or 0?

...chris

Spoiler

CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard

 

Link to comment
Share on other sites

My quibble is with the help file. Perhaps the wording could be improved. Is True equal to 1 and False to 0? Are "If 1 then ..." and "If True then" equivalent?

...chris

Spoiler

CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard

 

Link to comment
Share on other sites

  • Moderators

My quibble is with the help file. Perhaps the wording could be improved. Is True equal to 1 and False to 0? Are "If 1 then ..." and "If True then" equivalent?

...chris

Zero being the only "False" statement, as less than or greater than zero will be considered a "True" statement.

So when using a boolean statement, you need nothing more than If ($bool) Then or If (Not $bool) Then... Need not concern yourself with actual integer values.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
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
 Share

  • Recently Browsing   0 members

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