- Thu Dec 01, 2016 1:02 pm
#58949
Check your var contents.
Comparison of numbers requires only 1 equals (=) sign, whereas comparison of string characters requires 2 (==)
So your nested IFs must be expecting numeric=VARs else they would error if fed with strings.
I've predefined your vars as numeric to prove that the nested 'ifs' are indeed working correctly... if the inner IF T2Mon = mm THEN it branches, but if it doesn't equate (ie: T2Mon = mm -1) then it drops through without branching.
So I suspect you may have an error in your VAR types, possibly a time "string" instead of the numeric VAL(of the string).
Code: Select allRelayON = -1
hh = 77
mm = 88
T2Hon = hh
T2Mon = mm 'change this to T2Mon = mm - 1
if RelayON = -1 then
if T2Hon = hh then
if T2Mon = mm then
RelayON = T2D
goto [RlyOn]
end if
end if
end if
html "dropped through<br>"
end
[RlyOn]
html "branched<br>"
end