GLBasic forum

Main forum => Bug Reports => Topic started by: FutureCow on 2009-Jul-10

Title: Compilation error after with closing loops/conditional statements (very minor)
Post by: FutureCow on 2009-Jul-10
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.
Title: Re: Compilation error after with closing loops/conditional statements (very minor)
Post by: amarliani on 2009-Jul-10
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.
Title: Re: Compilation error after with closing loops/conditional statements (very minor)
Post by: MrTAToad on 2009-Jul-10
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)
Title: Re: Compilation error after with closing loops/conditional statements (very minor)
Post by: FutureCow on 2009-Jul-10
If it did a syntax check before compile then it would get around the problem wouldn't it?
Title: Re: Compilation error after with closing loops/conditional statements (very mino
Post by: MrTAToad on 2009-Jul-10
Thats right
Title: Re: Compilation error after with closing loops/conditional statements (very minor)
Post by: Moru on 2009-Jul-10
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 :-)