" -— - First words in BASIC Lotsof the words in BASICare based on English words and 1t 1s guite easy to guess what they mean For: instance, PRINT means "display on the screen', RUN means 'Carry out this program" and INPUT means "give the computer information". On these two pages you can find out how to use the word PRINT. Most home computers havea BASIC language interpreter inside themalready and when you switch them on they are ready to be programmed in BASIC." 2 READY PRINT "SNAILS"> To tell the computer to display words on the screen you use PRINT with the words you want in guotation marks. For instance, PRINT "SNAILS' tells it to display the word SNAILS on the screen. after each instruction. The computer will display on the screen | whatever you type between the guotation marks, It can be letters, numbers, words | or symbols. Note that it does not display the guotation marks themselves. "Some computers have to havea special program loaded from cassette tape before they understand BASIC. This is the cursor. It may also look like one ofthese: sd de "Me MW When you switch on a micro some words are usually displayed on the screen automatically, along with a small symbol called the cursor. The cursor shows where the next letter you type will appear. RETURN or READY PRINT "SNAILS" SNAILS > computer to carry outan instruction. The computer will not carry out your instruction, though, until you press NEWLINE (or RETURN or ENTER-'it varies on different computers) totell itthe instruction is complete. A . %/ Toclearthe 4 CLS,orthe A computer's MY A own word. 4 pobi w v vo ga d m Pa 24% IN. — z ž To display numbers by themselves, you do not need to use guotation marks. Now, to clear the screen you type CLSon most micros. (Check this in your manual if you have a computer.) Press NEWLINE, ENTERto teli the screen you type A program in BASIC In a program, each line of instructions starts with a number. This tells the computerto store the instructions in its memory and not to carry them out until you givethe go-ahead. On the opposite page, the instructions to the computer did not have numbers, so the computer carried them out straight away. Here is a short program which makes the computer display symbols in the shape of a face on the screen. On some computers the figure Ohasa line through it, like this. 10 PRINT "//////" Zaje mamine una le gv opi š » tenssoyou can add extra 20 PRINT k. Ji K ovuciičana veti 30 PRINT "1(..)I" renumbering the whole 40 PRINT "I -L |" program. 50 PRINT "VVVV" 60 END | sa youtell it to by typing RUN. Be careful not Many computers do not need this line. When you type in a program you haveto press NEWLINE (or the computers word) tomixup the letter O and the figure 0as this will cause a bug. Most computers have a RUBOUT or DELETE key for correcting typing mistakes. at the end of each line. The linesare displayed on the screen but the computer does not carry out the instructions until The computer displays exactly what you typed | betweenthe guotation marks, You type LIST (anc NEWLINE) to see program again. including the spaces. — > >— >—a If the program does not work, or the When you have typed in all the lines, picture does not look right, you need to check them carefuly to make sure there are no mistakes. Then, to tell the computer display the program again to find the bug. To do this you type LIST. The computer may give you an error message telling you what the bug is. to carry out the program, you type RUN, folowed by NEWLINE. ] Debugging programs RUN 4 Linetyped in again correctly. z aie" 10 PRINT "//////" | VP 30 PRINT "I(..)I" 40 PRINT "1 -LI1" VVVV. %— No guotes the program altogether, just type the line The computer will give you an error number, followed by NEWLINE. Each message for most bugs. The error messages are explained in the computers computer also has its own way for manual. The easiest way to correcta correcting or altering parts of lines, using mistake is to type the whole line again. The computer will replace the old line with the new one. To get rid ofa line from ll o, Program puzzle - Try changing the program to give the face different features. - — TI TEN Ma ea PH" Arne ara ad s. prom mer na o go p —— mam mo am aa aa o po EN go ge rr"