QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: gartho on June 03, 2019, 04:28:54 am

Title: syntax error on 'ELSE' in '$include: 'xxx.bm'
Post by: gartho on June 03, 2019, 04:28:54 am
QB64 ver 1.000
syntax error on 'ELSE'  in '$include: 'xxx.bm' when 'ELSE' is not first & only word in line
this is OK... 
IF fkey = 6 THEN
    do delete
ELSE
    do update
END IF
this gives 'syntax error' on 'ELSE' line when IDE does it's scan
IF fkey <> 27 THEN
    IF fkey = 6 THEN
        do delete procedure
    ELSE
        do update procedure
    END IF
END IF

the work-around...
    IF fkey = 6 THEN ....
    IF fkey <> 6 THEN ....

guess I should move to  v 1.3 huh?
Title: Re: syntax error on 'ELSE' in '$include: 'xxx.bm'
Post by: RhoSigma on June 03, 2019, 04:55:13 am
You probably have a TAB before the ELSE instead of spaces, which will error out when it happens to be in an $INCLUDed file.
And yes, you should definitly move to v1.3, cause v1.0 is years old.

BTW - The mentioned TAB glitch in includes was actually fixed in v1.3, see ChangeLog.
Title: Re: syntax error on 'ELSE' in '$include: 'xxx.bm'
Post by: gartho on June 03, 2019, 07:28:13 pm
YES!
is OK of I move 'ELSE' back to first char position
Many tnx.
Will d'load v1.3 & see what happens!