| Author | 
         | 
         
      
        
         
         cmhardwick Senior Member 
          
  
  Joined: July 08 2006 Location: United States
 Online Status: Offline Posts: 290
          | 
        
         
          
           | Posted: July 12 2008 at 17:39 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Maybe this is coming from programming background, but is there a way to have an IF statement execute multiple commands/steps?
 
 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
          | 
        
         
          
           | Posted: July 12 2008 at 18:09 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
I haven't tried it but I bet you can string formula together with +.
 
 
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
          | 
        
         
          
           | Posted: July 12 2008 at 20:02 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Yup. Just use a '+'...
 
 
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
          | 
        
         
          
           | Posted: July 12 2008 at 21:10 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Great! Thanks. I knew it had to be easy
  __________________ Cicero, Enjoying automation!
         | 
       
       
        | Back to Top | 
         
          
          
         | 
       
       
       
        |   |