| Author |  | 
      
        | cmhardwick Senior Member
 
  
  
 Joined: July 08 2006
 Location: United States
 Online Status: Offline
 Posts: 290
 | 
          Maybe this is coming from programming background, but is there a way to have an IF statement execute multiple commands/steps?
           | Posted: July 12 2008 at 17:39 | IP Logged |   |  
           | 
 |  
 For Example:
 If (a=1,{
 command 1
 command 2
 command 3},{
 command 1 if false
 command 2 if false}
 )
 
 I know in PH, the curly brace I used above is for Global Variables. What I'm wanting to do is update the other controllers and keypad buttons when a device is changed programatically, without having to use up a bunch of groups. I can issue the groupcu command to update the button state or the insteon command to update a controlling switchlinc status, but not both.
 
 Thanks!
 
 __________________
 Cicero, Enjoying automation!
 | 
       
        | Back to Top |       | 
       
       
        |  | 
        | jbbtex Senior Member
 
  
 
 Joined: February 15 2007
 Location: United States
 Online Status: Offline
 Posts: 181
 | 
          I haven't tried it but I bet you can string formula together with +.
           | Posted: July 12 2008 at 18:09 | IP Logged |   |  
           | 
 |  
 
 
| Code: 
 
    
    | 
      
       | if(a=1,ph_insteongroupcu("Kitchen","Sink",19) + ph_insteongroupcu("Kitchen","Table",19), ph_insteongroupcu("Kitchen","Sink",17) + ph_insteongroupcu("Kitchen","Table",17)) |  |  |  
 Let me know the results.
 
 __________________
 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 |     | 
       
       
        |  | 
        | TonyNo Moderator Group
 
  
  
 Joined: December 05 2001
 Location: United States
 Online Status: Offline
 Posts: 2889
 | 
          Yup. Just use a '+'...
           | Posted: July 12 2008 at 20:02 | IP Logged |   |  
           | 
 |  
 
 
| Code: 
 
    
    | 
      
       | if ( {condition}, {thing1} + {thing2}, {thingA} + {thingB} ) |  |  |  | 
       
        | Back to Top |       | 
       
       
        |  | 
        | cmhardwick Senior Member
 
  
  
 Joined: July 08 2006
 Location: United States
 Online Status: Offline
 Posts: 290
 | 
          Great! Thanks. I knew it had to be easy
           | Posted: July 12 2008 at 21:10 | IP Logged |   |  
           | 
 |  
 __________________
 Cicero, Enjoying automation!
 | 
       
        | Back to Top |       | 
       
       
        |  |