The two examples listed below do the same thing, but the IDE's indentation does not follow with the second one as it does in the first. I'm not suggesting this is a bug - note the subject title here: ...as expected. However, I don't understand why it ignores the indentation level in the second one. Is it, in deed, getting confused, or is there a logical reason why there is a difference between the two, with regards to the indentation flow?
REM EXAMPLE 1
FOR I% = 0 TO 1
IF I% = 0 THEN
PRINT "0"
ELSE
PRINT "1"
ENDIF
NEXT
REPEAT
REM "INDENTED"
UNTIL TRUE
REM EXAMPLE 2
FOR I% = 0 TO 1: IF I% = 0 THEN PRINT "0": NEXT ELSE PRINT "1": NEXT
REPEAT
REM "NOT INDENTED"
UNTIL TRUE
I suspect it's the two NEXT statements on your single line that are confusing it. Probably the level of parsing that the IDE does cannot pick up that they can't both get executed.
I've seen issues with indentation before, but they've always been my fault - indeed, I find it a useful warning that I've messed up...
DDRM wrote: ↑Sat 12 Mar 2022, 12:51
I find it a useful warning that I've messed up...
Me, too. I thought I had this time, and it took me ten minutes to find this issue. Unusually, (probably for the first time,) it wasn't me.
A while ago, I tried some simple programming in Python - wasn't impressed - and the NECESSARY indentations with that had to be input by the user. I'm glad BB4W does it automatically.
With a decent IDE programming in Python isn't too painful, though you do need to be VERY careful with indentation - the IDE will handle most of it, but it's easy to get careless when editing! My main gripe with Python vs BB4W (or BBC-SDL) is how painful a graphical output is, though there are libraries to support it. On the plus side, there are some fantastic specialist libraries!