Jump to content

Recommended Posts

Posted

it doesn't seem like this should display 2 message boxes, but it does... I couldn't remember if negatives evaluated as true or false, but rather than check the helpfile, i opened up scite and just wrote a check... then because i had nothing better to do, i threw in a 'Not' to see if the condition evaluated to false, but it didn't...

$a = 2
$b = 3
if $a - $b Then MsgBox(0,"yep","negatives evaluate to true")
if Not $a - $b Then MsgBox(0,"yep","negatives evaluate to true")
Posted

this

if Not $a - $b Then MsgBox(0,"yep","negatives evaluate to true")

evaluates to ...

(Not $a) - $b

0 -3

try...

if Not ($a - $:P Then MsgBox(0,"yep","negatives evaluate to true")

thanks, didn't even think to check precedence...

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
×
×
  • Create New...