Contents / Structure within BASIC / Previous chapter / Next chapter / Index
When building a house there are a number of options: one can chop trees down and tie them together to form a hut, one could use straw and mud if one had the skill to deal with those materials or one can use 'building, blocks' like windows, doors and bricks. Whichever materials one selects the planning and construction is made much easier if one has a clear understanding of the available structures.
The same type of argument applies when writing a computer program to solve a particular problem. A number of program structures are available and it is well worth while learning what each can do. If you are attempting a trivial job (making an orange box or adding up a set of numbers) then little or no planning is needed. On the other hand, building an extension to your house or writing a computer program to play a game does require planning if it is not going to 'crash' without warning. This planning will involve the use of a number of 'structures'.
Here are the main structures available on the BBC computer.
REPEAT...UNTIL
FOR...NEXT
IF...THEN...ELSE
PROCEDURES
FUNCTIONS
GOSUB
ON...GOTO
ON...GOSUB
14 REPEAT... UNTIL, TRUE and FALSE 87
17 PROCEDURES 102
19 GOSUB 113