Page 1 of 1

End if Without Block If Error

Posted: Mon Oct 15, 2012 1:59 pm
by JasonQuinn1992
I can't figure out why Im getting an error on this code:

READ A
IF A > 10 THEN PRINT "THAT'S IT" ELSE PRINT "MAYBE NEXT TIME"
END IF
DATA 15,0

Posted: Mon Oct 15, 2012 3:42 pm
by burger2227
One line IF statements do not require END IF. It is only required when it is a statement block to indicate the end:

Code: Select all

IF A > 10 THEN
  PRINT "That's it"
ELSE PRINT "Maybe next time"
END IF

Posted: Mon Oct 15, 2012 10:22 pm
by JasonQuinn1992
I was able to get this program to run thanks! :)