Hi,
I have problem. When i create:
vypinac = 0;
if vypinac == 1000 then "Nikdy se nestane";
I created "IF" that is not true, but the program always processes it. What is wrong ?
Thank You
If is all time true
Moderator: leecollings
If is all time true
- Attachments
-
- 2018-07-01_2037.png (14.31 KiB) Viewed 1078 times
-
- 2018-07-01_2037_001.png (23.01 KiB) Viewed 1078 times
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: If is all time true
Hi, unfortunately nested ifs do not work in blockly (at least the last I checked). Also all "else if"'s are executed even if previous ones are "true" which means you need to be very careful when setting the conditions. Finally, in cases where you only have one "If...do" (no else if), you shouldn't use the block with the small blue gear icon.
Re: If is all time true
Is there a chance that this problem will be solved?
it would be enough IF and ELSE. I need create "case". If X=1 do ... If X=2 do ... if X=3 do ...
it would be enough IF and ELSE. I need create "case". If X=1 do ... If X=2 do ... if X=3 do ...
Re: If is all time true
Create separate blocks: one for If x=a do something, one for If x=b do something else and a third one for If x = c do something new. And don’t use the If Do block with the blue square in the upper left corner when using single if/do statements. Keep the logic as simple as possible, the chances that it works are higher and it is easier to troubleshoot.
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: If is all time true
I guess there's a chance (if you refer to nested if's not working and all else if's being executed) but the issue has been there for years so instead of waiting for a fix, I'd either try to build and commit the fix myself or set the conditions so that the outcome is what you need. Or even better, switch to Lua / dzVents

Who is online
Users browsing this forum: No registered users and 1 guest