Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: "if-then" without "else" Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
jpcurcio
Senior Member
Senior Member
Avatar

Joined: April 01 2007
Location: United States
Online Status: Offline
Posts: 119
Posted: April 22 2007 at 22:02 | IP Logged Quote jpcurcio

I want to check the status of a light; if it's off, I want to turn it on (to, say, 50%), else do nothing. So far, I have this:

if(ph_getinsteonlevel("L1")<1, ph_insteon("L1", ion, 127), 1)

Is this the best way to do (essentially) a NULL command for the "else"? Or is the some other "good programming practice" I should observe?

-JPC
Back to Top View jpcurcio's Profile Search for other posts by jpcurcio
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: April 22 2007 at 23:05 | IP Logged Quote TonyNo

Yup, that's fine.
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
bhlonewolf
Senior Member
Senior Member


Joined: March 29 2007
Online Status: Offline
Posts: 198
Posted: April 22 2007 at 23:10 | IP Logged Quote bhlonewolf

I'm thinking this answers my question about turning off a light posted a little while ago. Thanks :)
Back to Top View bhlonewolf's Profile Search for other posts by bhlonewolf
 
jpcurcio
Senior Member
Senior Member
Avatar

Joined: April 01 2007
Location: United States
Online Status: Offline
Posts: 119
Posted: April 23 2007 at 00:17 | IP Logged Quote jpcurcio

TonyNo wrote:
Yup, that's fine.


Thanks again, Tony.
Back to Top View jpcurcio's Profile Search for other posts by jpcurcio
 

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