bug on "if", "end if", etc.? - Printable Version

+- Forum (
+-- Forum: Compilers and Computer Languages (
+--- Forum: ZX Basic Compiler (
+---- Forum: Help & Support (
+---- Thread: bug on "if", "end if", etc.? (/showthread.php?tid=854)

bug on "if", "end if", etc.? - nitrofurano - 09-30-2018

when trying to compile this code on 1.8.8:
dim i as ubyte
if i>2 then:
  print "3>2"
  end if

i get this error message when compiling
endifbug.bas:5: Syntax Error. Unexpected token 'IF' <IF>

on other few tests i tried, the same happened on "end if"

RE: bug on "if", "end if", etc.? - boriel - 12-30-2020

Sorry, Nitro, I completely overlooked this post Sad

It turns out you cannot use ":" after then if you want a block-sentence if. The syntax was changed on 1.6.x
":" Colon after then means you have to finish the IF in the same line like in traditional BASIC (so remove it there to allow the program to compile)