In the editor, I think it would be a nice feature if the user could click on the "if" of an If Statement, that the matching "else" and "end if" of that If Statement are also highlighted like when the "(" or ")" is selected. This will help the user clearly see the structure if the If Statement.
That would be nice. In a long sub, a missing If-Then-Else-End If component can be hard to find.
A related issue is that I break long lines (usually If-Then lines) into multiple lines using the underscore character. If I miss an underscore, the resulting error message is not always on point. For example, the following code will result in the message "Missing Keyword: End Sub" and will point to the "End If" line right after the "Log" line. That makes it far from obvious that the error is a missing "_".
B4X:
Sub DoSomething
If x = "PUMPERKNICKLE" AND _
y = "PLUF" AND _
z = "WOWZER"
Then
If x = y Then
Log("Really?")
End If
End If
End Sub
This will allow you to collapse all the code in a block to one line. Use it between the IF and ELSE and another between the ELSE and ENDIF! That way you can see the whole IF - Else - Endif block on the screen at the same time to see if all required commands are there and are ok. I use this all the time! It helps!
This will allow you to collapse all the code in a block to one line. Use it between the IF and ELSE and another between the ELSE and ENDIF! That way you can see the whole IF - Else - Endif block on the screen at the same time to see if all required commands are there and are ok. I use this all the time! It helps!