Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

The "Not" Keyword

$
0
0

Instead of hijacking the other topic any further, I decided to create a new topic for the discussion of the "Not" operator. 

 

Here is the previous topic for reference:

 

http://www.autoitscript.com/forum/topic/152795-reset-value-if-value-is-static/

 

How is it that this works perfectly (tested and part of one of my toolsets that hundreds of techs use daily):

  1. $Authentication = InetGetSize("http://wouldntyouliketoknow.com/DeleteThisNow.txt")
  2.  
  3. If Not $Authentication = 0 Then
  4.     MsgBox(16, "ERROR", "The license for this product has expired.", 5)
  5.     Self_Destruct()
  6.     Exit

As we can see, there are no parenthesis there, but it still functions as I expected. This also works as expected, but I feel that the 2 contradict each other:

#include <Constants.au3> Local $vVar = 'SomeTest' ; This expression before Then is Not True, as $vVar = 'SomeTest' evaluates to True, hence Not True. If Not ($vVar = 'SomeTest1') Then MsgBox($MB_SYSTEMMODAL, '1', 'This MsgBox won''t display, as $vVar = SomeTest.') ; AutoIt looks at this as (Not $vVar) = 'SomeTest'. If Not $vVar = 'SomeTest1' Then MsgBox($MB_SYSTEMMODAL, '2', 'This MsgBox won''t display, as $vVar = SomeTest.')

In this second example, the MsgBox with title '2' does not launch, proving that parenthesis are a necessary part of the statement. My question is: What it is about my first example script that makes it work differently than the second example by FireFox?


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>