Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: multiple commands in If statements? Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
cmhardwick
Senior Member
Senior Member
Avatar

Joined: July 08 2006
Location: United States
Online Status: Offline
Posts: 290
Posted: July 12 2008 at 17:39 | IP Logged Quote cmhardwick

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 View cmhardwick's Profile Search for other posts by cmhardwick Visit cmhardwick's Homepage
 
jbbtex
Senior Member
Senior Member


Joined: February 15 2007
Location: United States
Online Status: Offline
Posts: 181
Posted: July 12 2008 at 18:09 | IP Logged Quote jbbtex

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 View jbbtex's Profile Search for other posts by jbbtex
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: July 12 2008 at 20:02 | IP Logged Quote TonyNo

Yup. Just use a '+'...

Code:
if ( {condition}, {thing1} + {thing2}, {thingA} + {thingB} )
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
cmhardwick
Senior Member
Senior Member
Avatar

Joined: July 08 2006
Location: United States
Online Status: Offline
Posts: 290
Posted: July 12 2008 at 21:10 | IP Logged Quote cmhardwick

Great! Thanks. I knew it had to be easy

__________________
Cicero, Enjoying automation!
Back to Top View cmhardwick's Profile Search for other posts by cmhardwick Visit cmhardwick's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum