Contents / Reference section / Previous chapter / Next chapter / Index


33 BASIC keywords


This chapter contains a detailed description of every word that BASIC understands. These words are called "keywords".


AABS, ACS, ADVAL, AND, ASC, ASN, AUTO
B BGET, BPUT
C COLOUR, CALL, CHAIN, CHR$, CLEAR, CLOSE, CLG, CLS, COS
D DATA, DEG, DEF, DELETE, DIV, DIM, DRAW
E ENDPROC, END, ENVELOPE, ELSE, EVAL, ERL, EOF, EOR, ERR, EXP, EXT
F FOR, FALSE, FN
G GOTO, GET$, GET, GOSUB, GCOL
H HIMEM
I INPUT, IF, INKEY$, INKEY, INT, INSTR(, LIST
L LOAD, LOMEM, LOCAL, LEFT$(, LEN, LET, LOG, LN
M MID$(, MODE, MOD, MOVE
N NEXT, NEW, NOT
O OLD, ON ERROR, ON GOTO, ON GOSUB, OR, OPENIN, OPENOUT
P PRINT, PAGE, PTR, PI, PLOT, PROC, POS, RETURN
R REPEAT, REPORT, READ, REM, RUN, RAD, RESTORE, RIGHT$(, RND, RENUMBER
S SAVE, SGN, SIN, SQR, SOUND, SPC, STR$, STRING$(, STOP
T TAN, TAB(, TIME, TRACE, TRUE
U UNTIL, USR
V VDU, VAL, VPOS
W WIDTH

Some parts of the description are intended for the novice user, and others for the person who is familiar with BASIC. Each keyword is described under a number of headings as follows:

KEYWORD sometimes followed by a few words explaining the derivation of the word

Purpose

A plain-English description of what the keyword does. This is intended for the person who is learning BASIC

The only technical terms used are "string" and "numeric" - if you don't understand those two words then read section 9 on page 62 first. The mathematical functions SIN, COS, TAN, etc are not explained for the absolute beginner - there just isn't enough room to explain everything!

Examples

This section gives a few one-line examples of the use of the keyword (not complete programs). Some of the examples have a number at the start of the line. This number is an "example line-number".

The examples are only intended to be illustrative. In some cases a line of BASIC program may overflow onto the next line as elsewhere in this book.

Description

In this section the keyword is described using normal computer jargon.

Known problems

Any known bugs are described here.

Syntax

The syntax of each keyword's usage is given more by way of helpful explanation than for its rigorous accuracy. Purists will, rightly, complain at this travesty of Backus-Naur Form (BNF). Others may find the entries useful.

The following symbols are used as part of the syntax explanation:

{} denotes possible repetition of the enclosed symbols zero or more times

[] enclose optional items

| indicates alternatives from which one should be chosen

<num-const> means a numeric constant such as "4. 5" or "127"

<num-var> means numeric.- variable such as "X" or "length"

<numeric> means either a <num-const> or a <num-var>, or a combination of these in an expression for example "4*X+ 6"

<string-const> means a string enclosed in quotation marks, e.g. "GAVIN MOUNT"

<string-var> means a string variable such as A$ or NAME$

<string> means either a <string-const> or a <string-var>, or an expression such as A$+"WOMBAT"

<testable condition> means something which is either TRUE or FALSE. Since TRUE and FALSE have values it is possible to use a <numeric> at any point where a <testable condition> is required. The distinction between these two is, in fact, rather unnecessary.

<statement> means any BASIC statement, for example, PRINT or GOSUB or PROC

<variable name> means any sequence of letters or numbers that obeys the rules for variables (see pages 24, 62 and 120).

Associated keywords

This section is intended to draw your attention to other keywords which either have similar functions or which are normally used in conjunction with this keyword. You will probably find it helpful to read the pages which describe the associated keywords.

Demonstration program

If appropriate a short program is included to illustrate the use of the keyword.

Exit: BBC Microcomputer User Guide; Kasoft Typesetting; Archer


The BBC Microcomputer User Guide was written by John Coll and edited by David Allen for the British Broadcasting Corporation.

Optical character recognition and original formatting effort by Mark Usher.

HTML version maintained by: Kade "Archer" Hansson; e-mail: archer@dialix.com.au

Last updated: Monday 12th February 2001