Tiny BASIC

Interpreter and Compiler Project

Getting Started

Some versions of BASIC have their own environment for entering programs, with commands or buttons that can list, run, load or save your programs.

Tiny BASIC is simpler than that. You create your programs using a text editor, like Notepad or vi. Then you run them from the command line. The exact nature of the editor and the command line will vary from system to system, but this tutorial will assume that you know how to use your text editor, and that you have installed Tiny BASIC in such a manner that you can run it on the command line by typing its name. So if you write a program called program.bas, you should be able to run it by typing the following at the command line:

tinybasic program.bas

The process of creating a program is therefore to create and edit it with your text editor, run it with a command like the one above, find that it has bugs, correct them, run again, and repeat this process until your program is finished and works properly. You will probably want to have a command prompt and the text editor open continuously in separate windows, if your system allows it.

A BASIC program contains a number of lines. Each line has a number, which is its label, and a statement, which is in the form of a command and some data. You'll learn the purpose of the labels when we come to the GOTO and GOSUB commands. But first, we'll look at how to print things on the screen.

Next: Printing Things

Comments

New Comment

Yes No