Author Topic: syntax error on 'ELSE' in '$include: 'xxx.bm'  (Read 2133 times)

0 Members and 1 Guest are viewing this topic.

Offline gartho

  • Newbie
  • Posts: 2
    • View Profile
syntax error on 'ELSE' in '$include: 'xxx.bm'
« 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?

Offline RhoSigma

  • QB64 Developer
  • Forum Resident
  • Posts: 565
    • View Profile
Re: syntax error on 'ELSE' in '$include: 'xxx.bm'
« Reply #1 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.
« Last Edit: June 03, 2019, 04:56:57 am by RhoSigma »
My Projects:   https://qb64forum.alephc.xyz/index.php?topic=809
GuiTools - A graphic UI framework (can do multiple UI forms/windows in one program)
Libraries - ImageProcess, StringBuffers (virt. files), MD5/SHA2-Hash, LZW etc.
Bonus - Blankers, QB64/Notepad++ setup pack

Offline gartho

  • Newbie
  • Posts: 2
    • View Profile
Re: syntax error on 'ELSE' in '$include: 'xxx.bm'
« Reply #2 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!