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
End if Without Block If Error
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
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
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
-
- Coder
- Posts: 42
- Joined: Mon Sep 03, 2012 4:32 pm