1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Just a verification regarding "Iff" and both "status test(s)" and "relational expression(s)"...

Discussion in 'Support' started by mathewsdw, Mar 7, 2012.

  1. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    One can't write a conditional expression that takes the form (as a simple example): "EXIST afilename .AND. aVariable != 0", correct?
     
  2. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    YES. But beware: the parser evaluates everything in the conditional expression, so even if the first test fails, the second test will be executed. If the first needs to succeed or performing the second test itself causes errors, you need two separate tests, e.g., if %@ready[x:] if %@diskfree[x:,M] LT 100 ...
     
  3. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,860
    Likes Received:
    83
    WAD -- the parser cannot know if you're going to reverse everything with an OR in the second (or third or fourth ...) test.
     
  4. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    All I intended is to warn the user and provide an alternate method I have used for many years (which proves of my long-term awareness of the issue). I made no criticism of the parser's operation, nor did I attempt to explain the reasons for its design.
     

Share This Page