Acorn Computers BBC Micro Model B w/8271 — Acorn BBC Micro Model B w/8271 User Guide Manual PDF (EN)

43 7 AUTO, DELETE, REM, RENUMBER BASIC provides a number of facilities to help the user enter programs into the computer and modify programs already there. As you will know by now, it is usual to use line numbers 10, 20, 30, 40 etc for programs. This leaves gaps where the user can insert extra lines later on – for example, he or she might insert lines 11, 12, 13 and 14. When typing in a line of program the user types in the line number first and then the rest of the line. For example: 10 PRINT "THIS IS A PROGRAM" The command AUTO instructs the computer to ‘assign’ the line numbers automatically for the user. As an option you can tell the computer to start assigning lines from any number.

Thus AUTO 300 would make the computer produce line number 300, then 310, then 320, etc. There are other options, too, which are explained in chapter 33. The command DELETE allows the user to delete a group of lines from his or her program. When you are writing a long program you often need to be able to delete a large section of it. The keyword DELETE is followed by two numbers which give the first and last lines that you wish to remove. For example DELETE 150,330 would delete all the lines with numbers between 150 and 330. Single lines can be removed by typing in the line number and pressing RETURN . REM is a very useful statement.

It enables you to put remarks in your program to remind you (not the computer) what is going on. If you are developing a big program – or loading a simple program that you have not used for some time it is very easy to forget how it works or what it does. Normally people place several REM s at the start of a program to give general information and then put a REM at major points further down the program.