Open dkearns opened 3 years ago
You will probably hate what happens with:
FOR i = 1 TO 10
FOR j = 1 TO 10
PRINT a
NEXT j, i
I still think it's all behaving as expected.
No, I think that's the only sensible way to format your example (i.e., the indent level should be relative to the line above).
FWIW, having a quick look through my QB64 samples archive I note at least one example in wetspot.bas
but you could probably find examples of any formatting you like in that archive.
Changes previously applied with https://github.com/QB64Team/qb64/commit/1e679627f4edf2a02cc7ba5757526c9f205a6be1 have been reverted until a more stable solution can be found.
Sample code giving issues:
FOR y%% = 0 TO 3: FOR x%% = 0 TO 7
IF 1 THEN
PRINT
END IF
NEXT x%%, y%%
It appears to be a reasonably common style to format nested statements, usually loops, like this:
Whether this is good style is, hopefully, a question for another day. However, I've noticed that the IDE is currently indenting the contained statement block once for each level of statement nesting.
The aim of this formatting style is presumably to keep things compact so I was wondering if it might be better to use a single level of indentation here?
I noticed this because my inherited legacy code, which uses this style heavily, was formatted with a single indent level.
Thanks, Doug