[Solved] ELSE-IF not working for me

I have IF, ELSE-IF, ELSE-IF, ELSE-IF, ENDIF.
The IF is false so it should go on to the first ELSE-IF. This ELSE-IF is TRUE, but it gets skipped. I am very experienced with these kinds of conditionals and this makes no sense to me. Here is my log (read from the bottom up):

Action: // Set Energy Saver, if not already. (skipped)
Action: ELSE-IF (Variable WH_Mode(High Demand) is ? 'Energy Saver'(T) AND Variable Upper(126.8) is >= WH_Normal_Temp(119)-3.5(T) [TRUE]) THEN (skipped)
...
...
Action: // Set High Demand, if not already (skipped)
Action: IF (Variable WH_Mode(High Demand) is ? 'High Demand'(F) AND ( ( Variable Rate_Of_Change(-0.02502) is > ROC_For_HD(1.99)(F) AND Variable PC1(113.6508) is < 90.0(F) ) OR Variable PC1(113.6508) is < 50.0(F) OR Variable PC2(113.8776) is <= 40.0(F) ) [FALSE]) THEN (skipping)

Could you do three things?

  1. Post a screenshot of your rule.
  2. Post a screenshot of the logs from when the rule runs. It is much easier to read a screenshot v/s cut and paste text.
  3. Please don't omit any intervening logs (as long as they are also generated by the rule). This is also avoided by using a screenshot.

From the little information you've posted, it is possible that your rule met an earlier conditional that was satisfied?

2 Likes

It wasn't that simple, but it was my mistake. My rule is 120 lines long, and I missed and extraneous IF that had no ENDIF. In other languages I have used, this would have been flagged as an error.

I will have to be more careful in the future. Thanks for your help.

1 Like

FYI, Rule Machine is not a programming language.

3 Likes