Author |
|
Manny Senior Member
Joined: March 23 2003 Location: United States
Online Status: Offline Posts: 172
|
Posted: June 21 2006 at 18:25 | IP Logged
|
|
|
I am very sure this has been covered but for some reason I'm not hitting the right key words in my searches.
lamp = A1
I'd like to send one x10 command to either turn on the lamp if it's currently off, or turn off the lamp if it's currently on. This way I do not have to have 2 seperate buttons on my limited pda real estate.
BTW the Palm program I'm goofing around with is called Shortcutter. Using Bluetooth (no wifi on my palm)it can use the PH SocketServer to talk to PH. This is a lot faster than the webpage method for these old PDAs.
If I get this going I can keep a couple of old PDA's from collecting dust.
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: June 21 2006 at 19:40 | IP Logged
|
|
|
Use...
if( ph_getx10stat( "LAMP" )=0, 0, ph_x10btn( "LAMP", case( ph_getx10stat( "LAMP" ) when 2 then 3 when 1 then 2), 0 ))
This Shortcutter?
|
Back to Top |
|
|
Manny Senior Member
Joined: March 23 2003 Location: United States
Online Status: Offline Posts: 172
|
Posted: June 21 2006 at 20:00 | IP Logged
|
|
|
Tony,
Never hesitate to "dumb" things down for me. Er, I mean the newbies may need a bit more detail.
Seriously, I will not be offended with "Step 1: Place hand on mouse"
Where/ how do I use the if statement?
Plus, yes that's the pda program. I forgot that it may be useful for you hoity-toity PocketPC types as well.
Edited by Manny - June 21 2006 at 20:00
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: June 21 2006 at 20:12 | IP Logged
|
|
|
That is just a formula that you could put in a trigger, a macro, a web-based URL, etc.
If using PHSSCMD.exe you would run this for the toggle button...
"D:\Program Files\PHSSCMD\phsscmd.exe" if( ph_getx10stat( "LAMP" )=0, 0, ph_x10btn( "LAMP", case( ph_getx10stat( "LAMP" ) when 2 then 3 when 1 then 2), 0 ))
Let me know if you need more!
|
Back to Top |
|
|
Manny Senior Member
Joined: March 23 2003 Location: United States
Online Status: Offline Posts: 172
|
Posted: June 21 2006 at 21:41 | IP Logged
|
|
|
Once again, thank you. I'll try it once I get home.
I had no clue that you could start a formula with "if".
I'm sure my eyes just glazed over any similar examples.
I thought you were giving me a snippet of something that required a script with variables, etc...
All my formulas have been of the "ph_do-something" variety.
This is just by using Alt-F12 as a guide.
Anyway, you just gave me one of those "oh" moments when I finally "get" something.
Hope this helps others...I can't be dumbest in the class...again.
|
Back to Top |
|
|