Chapter 1: Idiots Guide to QBasic

1.1 Introduction
Before you read on, I'm assuming you already have a copy of QBasic, or similar BASIC Language. Just so we know you're not a complete idiot, I'm also assuming you know how to use it (at least know how to run and load programs).
1.2 Line Numbers in QBasic
Line Numbers are dead, QBasic does not require that you type in a line number for each and every line. Although there's nothing wrong with it, a line number is treated like a label. What's a label? It's like a bookmark, just think about that, having 1000 lines or 1000 bookmarks. QBasic must parse through this junk, although you may not see any side-effects of this, just avoid line numbers if at all possible. For most compilers, labels (or line numbers) are stored in memory, so this is a big waste of memory.
1.3 Why is '?' and typing 'PRINT' equivalent?
        ?"Hello World!"
        PRINT "Hello World!"
        
Not only is it much faster to type '?' but in the old days it also saved 4 bytes! Yes, this was significant, it was apparent in all programming languages, especially C. Anyway, type whatever you're comfortable with, I'm sure the '?' would be much preferred over PRINT.
1.4 Obtaining help from QBasic
In case you didn't already know, just click on help when in QBasic's IDE and you can look up all the keywords that QBasic supports. You can also type the keyword (like OPEN), then press F1 and you will see the help text on OPEN.

Back to Contents Next: Chapter 2