solve "else if" confusion by changing icon layout to "next if"

Moderator: leecollings

Post Reply
willemd
Posts: 738
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

solve "else if" confusion by changing icon layout to "next if"

Post by willemd »

As documented in the wiki (although not very clear) and as discussed many times in this forum, the blockly "else if" does not behave like it would do in any other programming language. Normally this part would only be executed if the preceding "if" condition would be not true, but in blockly it is executed no matter what. The "else if" condition is just evaluated sequentially independent of whatever the result of the preceding "if" condition was.

Instead of implementing this properly and fix the behaviour, I suggest that at least the confusion is solved by changing the "else if" icon layout into a "next if" icon layout, so at least the displayed blockly matches the behaviour. If this is changed, then even all existing blockly statement are automatically corrected and more readable and consistent. So I mean, just show the text "next if" in the green blockly control block image where it currently shows the text "else if".
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest