GLBasic forum

Main forum => Bug Reports => Topic started by: Moru on 2010-Jan-31

Title: IF THEN bug? (no showstopper)
Post by: Moru on 2010-Jan-31
Code (glbasic) Select
IF a = TRUE THEN
DEBUG "hello"


This no longer makes the compiler complain, it used to, right? No showstopper, just caused some confusion tonight :-)
Title: Re: IF THEN bug? (no showstopper)
Post by: Quentin on 2010-Jan-31
interesting.
Just tested it, but the compiler will handle this as two separate command lines. Means line "DEBUG "hello" is executed in any case, even if a = FALSE
I'm not sure if this worked before.
Title: Re: IF THEN bug? (no showstopper)
Post by: Scott_AW on 2010-Jan-31
Last version I have is 7.242(i think) and that would for sure crash if I left an open THEN.  I try not to use it either.

Title: Re: IF THEN bug? (no showstopper)
Post by: FutureCow on 2010-Feb-01
I put in a request ages ago that THEN become an optional keyword for multi line conditions. Gernot wasn't keen on the idea, so I doubt it's been implemented.
Title: Re: IF THEN bug? (no showstopper)
Post by: Kitty Hello on 2010-Feb-01
IF xxx
   yyy
ENDIF

_OR_

IF xxx THEN yyy

No then for multiline IF
Title: Re: IF THEN bug? (no showstopper)
Post by: Quentin on 2010-Feb-01
that's clear, but it wasn't the question :)
We were just wondering about that a command like
Code (glbasic) Select

IF a = TRUE THEN

without anything following the THEN doesn't cause an error
Title: Re: IF THEN bug? (no showstopper)
Post by: Kitty Hello on 2010-Feb-01
Because newline and ; are a command in my parser. I'll add an error. Doh!