If conditional statement
CelticLord
Posts: 50
in Propeller 1
What is wrong with this IF statement's AND conditional..If !((iHour == iHsoak) && (iMin == iMsoak) && (iSec == iSsoak))
It keeps pointing at the second & and says(Expected an expression term)
It keeps pointing at the second & and says(Expected an expression term)
Comments
-Phil
Ifnot ((iHour == iHsoak) AND (iMin == iMsoak) AND (iSec == iSsoak))
In C it would be
if (!((iHour == iHsoak) && (iMin == iMsoak) && (iSec == iSsoak)))
AND is a boolean operator that evaluates both the left and right sides, and then ands them together.
&& is a short circuit operator that evaluates the left side and if that side is true, evaluates the right side.
Ignoring the (!), you need to write: