The Basics of QBasic

 

BASIC stands for Beginner's All-Purpose Symbolic Instruction Code. There are different versions of BASIC, like Quick Basic or Visual Basic. They are all programming languages. If you are wondering how to get a copy of QBasic, try the Windows 95 CD.

It takes a while to learn QBasic thoroughly, but once you know the language, its possibilities are endless! To help those of you that are beginners at it, we have included the following words and have explained what they do. There is also a part telling you what colours are which numbers:

Some words to help you:

xxx = your text

x = a number

PRINT "xxx" = Print the text onto the screen.

CLS = Clear the screen.

COLOR x = Set the colour for text, lines, etc.

INPUT xxx$ = Store what you type in while running the program into memory.

LPRINT "xxx" = Print text out on the printer.

END = End the program.

STOP = Stop the program.

SCREEN x = Change the screen mode. (Different screen modes can have different ranges of colour, different sizes, etc)

LINE (x, x)-(x, x), x, B/BF = Draw a line/box(first four x's are co-ordinates on the screen, fifth x is a colour number ,B is to draw an unfilled box and BF is to draw a filled box. leave blank to draw an ordinary line.)

CIRCLE (x, x), x = Draw a circle.(first two x's are co-ordinates and the third x is how large the circle is.

GOTO x = Goto a labled line. You have to label the selected line first though!

DECLARE SUB xxx() = Make a sub. This is a section of the file that can be reffered to by using the CALL command (see below).

CALL xxx = Goto a sub(x). You have to make the sub first though!

x$ = "xxx" = Write something to the x$.

CHR$(x) = A special charactor or symbol.

 

Colour numbers:

0 = Black

1 = Dark Blue

2 = Dark Green

3 = Turquoise

4 = Red

5 = Purple

6 = Orange/Brown

7 = Light Grey

8 = Dark Grey

9 = Light Blue

10 = Light Green

11 = Light Turquoise

12 = Peach

13 = Light Purple

14 = Yellow

15 = Bright White

16 = Black

Add 16 to the previous numbers to make them flash.