Author |
|
Brandon Newbie
Joined: December 29 2009 Location: United States
Online Status: Offline Posts: 36
|
Posted: September 12 2010 at 20:25 | IP Logged
|
|
|
I am having trouble with getting the following code to work.
IF(ph_getglobal_n("LEVEL1") > ph_getglobal_n("LEVEL1_THRESHOLD") AND "{THRESHOLDLVL1TYPE}" = "ATTENTION", ph_comsendstring(1, "254\8"), ph_comsendstring(1, "254\0"))
LEVEL1 - number from 1-100
LEVEL1_THRESHOLD - number from 1-100
THRESHOLDLVL1TYE - string
Bt
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: September 13 2010 at 09:05 | IP Logged
|
|
|
Which part is not working?
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
Brandon Newbie
Joined: December 29 2009 Location: United States
Online Status: Offline Posts: 36
|
Posted: September 13 2010 at 10:12 | IP Logged
|
|
|
BeachBum wrote:
Which part is not working? |
|
|
Beach:
The IF logic is not working.
IF(ph_getglobal_n("LEVEL1") > ph_getglobal_n("LEVEL1_THRESHOLD") AND "{THRESHOLDLVL1TYPE}" = "ATTENTION",
The ph_comsendstring commands work fine (previously tested).
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: September 13 2010 at 10:38 | IP Logged
|
|
|
When I tested it I found if the case of "ATTENTION" was different than the global "attention" it would fail.
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
Brandon Newbie
Joined: December 29 2009 Location: United States
Online Status: Offline Posts: 36
|
Posted: September 13 2010 at 12:43 | IP Logged
|
|
|
BeachBum wrote:
When I tested it I found if the case of "ATTENTION" was different than the global "attention" it would fail. |
|
|
I have the cases matching ATTENTION = ATTENTION.
It seems very straightforward.
Bt
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: September 13 2010 at 13:41 | IP Logged
|
|
|
This is what I plugged in:
IF(ph_getglobal_n("LEVEL1") > ph_getglobal_n("LEVEL1_THRESHOLD") AND "{THRESHOLDLVL1TYPE}" = "attention", 0, 1)
The global values where:
LEVEL1 = 10
LEVEL1_THRESHOLD = 8
THRESHOLDLVL1TYPE = attention
I received back 0. If I change the formula to ATTENTION I receive back a 1.
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
Brandon Newbie
Joined: December 29 2009 Location: United States
Online Status: Offline Posts: 36
|
Posted: September 13 2010 at 21:27 | IP Logged
|
|
|
BeachBum wrote:
This is what I plugged in:
IF(ph_getglobal_n("LEVEL1") > ph_getglobal_n("LEVEL1_THRESHOLD") AND "{THRESHOLDLVL1TYPE}" = "attention", 0, 1)
The global values where:
LEVEL1 = 10
LEVEL1_THRESHOLD = 8
THRESHOLDLVL1TYPE = attention
I received back 0. If I change the formula to ATTENTION I receive back a 1.
|
|
|
Beach:
I found the problem. doh!
The 254 in the ph_comsendstring needs a "\" before it as well so "\254\8" instead of "254\8" has it working.
Thanks,
Bt
|
Back to Top |
|
|