| Author |  | 
      
        | Lenny Senior Member
 
  
 
 Joined: January 06 2008
 Online Status: Offline
 Posts: 102
 | 
          
           | Posted: May 23 2010 at 11:40 | IP Logged |   |  
           | 
 |  Maybe I'm not going around this the best way. I want to process code IF and only IF 2 GlobalVariables are TRUE.
 
 So IF MODE=VACATION and OHDSTATUS=OPEN perform action.
 I'm putting this in a single entry in my macro that updates keypad buttons for OHD Status since it's executed every time the state changes.
 
 It seems to be ignoring the 1st IF anf processing it as true. Works fine with 1 IF.
 
 /*VACATION MODE OVERHEAD DOOR ALARM*/
 
 if("{MODE}" = "VACATION",if("{OHDSTATUS}" = "OPEN",ph_sendsmtpemail ("My.smtp-server.com", 25, "FROMeMail", "TOeMail", "OVERHEAD DOOR OPEN!", "VACATION MODE ACTIVE - OVERHEAD DOOR OPEN!"),0),0)
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | sjvonstein Groupie
 
  
 
 Joined: February 05 2010
 Location: United States
 Online Status: Offline
 Posts: 75
 | 
          Your ordering of the if statements appears to be correct.  Are you receiving any formula syntax errors?
           | Posted: May 23 2010 at 12:20 | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |     | 
       
       
        |  | 
        | sjvonstein Groupie
 
  
 
 Joined: February 05 2010
 Location: United States
 Online Status: Offline
 Posts: 75
 | 
          *Deleted*  See better suggestion below.
           | Posted: May 23 2010 at 12:32 | IP Logged |   |  
           | 
 |  
 Edited by sjvonstein - May 23 2010 at 15:44
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | jbbtex Senior Member
 
  
 
 Joined: February 15 2007
 Location: United States
 Online Status: Offline
 Posts: 181
 | 
          So you want one action if both statements are true and
           | Posted: May 23 2010 at 14:54 | IP Logged |   |  
           | 
 |  another action if either are false?  Then try this way.
 
 if("{MODE}" = "VACATION" AND "{OHDSTATUS}" =
 "OPEN",ph_sendsmtpemail ("My.smtp-server.com", 25,
 "FROMeMail", "TOeMail", "OVERHEAD DOOR OPEN!", "VACATION
 MODE ACTIVE - OVERHEAD DOOR OPEN!"),0)
 
 
 edit: removed extra ',0)'
 
 Edited by jbbtex - May 23 2010 at 21:12
 
 __________________
 Brady
 
 "Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity." - Gen. George S. Patton
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Lenny Senior Member
 
  
 
 Joined: January 06 2008
 Online Status: Offline
 Posts: 102
 | 
          
           | Posted: May 23 2010 at 19:16 | IP Logged |   |  
           | 
 |  
| jbbtex wrote: 
 
    
    | 
      
       | So you want one action if both statements are true and another action if either are false?  Then try this way.
 
 if("{MODE}" = "VACATION" AND "{OHDSTATUS}" =
 "OPEN",ph_sendsmtpemail ("My.smtp-server.com", 25,
 "FROMeMail", "TOeMail", "OVERHEAD DOOR OPEN!", "VACATION
 MODE ACTIVE - OVERHEAD DOOR OPEN!"),0),0)
 |  |  |  
 Doh, now I feel dumb :) I was thinking If/If or If/Then... Changing to single IF with AND operator and removing the last ,0  it works as it should.
 Thanks so much
 
 
 
 Edited by Lenny - May 23 2010 at 19:18
 | 
       
        | Back to Top |     | 
       
       
        |  |