Compilation error after with closing loops/conditional statements (very minor)

Previous topic - Next topic

FutureCow

If you type an if statement in the format

Code (glbasic) Select

if [condition]
         [do whatever]
endif


and hit f8 to compile after typing "endif" but before hitting enter / an arrow key etc, compilation fails with an "IF without ENDIF / THEN" error.

The same problem occurs if you type a loop in and hit F8 immediately after typing the "T" in "next" before GLBasic recognises the keyword in the editor.

Obviously moving the cursor so GLBasic recognises the command makes it work, but it should compile without having to do this as the code is correct.

amarliani

This seems to happen with all GLBasic native commands. I found that a bit annoying too, at least sometimes (every time I forget to hit space or an arrow key before compiling, to be exact). Would be fine if there might be a way to change that in V 7.

MrTAToad

Yes, the syntax checking isn't performed (where all commands are converted to uppercase) when you press F8 - its only if you move the cursor up or down (or press RETURN)

FutureCow

If it did a syntax check before compile then it would get around the problem wouldn't it?


Moru

GLBasic isn't alone with this, I already got used to always move the cursor up or down before compiling. I even do that when programming PHP or HTML or whatever :-)