Page 1 of 1

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

Posted: Tuesday 01 October 2019 16:11
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".