Editing A Program; Edit Method; Copy Cursor Method - AMSTRAD CPC464 User Manual

Cpc464 colour personal computer 64k
Hide thumbs Also See for CPC464:
Table of Contents

Advertisement

EDITING A PROGRAM

If any of the lines in the program had been typed incorrectly, resulting in a Syntax error or other
error message, it would be possible to edit that line rather than type it out again. To show this you
can type the previous program out incorrectly.
Type in the following:
5 clss
1 0 i n p u t " w h a t i s y o u n a m e " ; a $ [ E N T E R ]
2 0 i n p u t " w h a t i s y o u r a g e " ; b [ E N T E R ]
3 0 p r i n t " I m u s t s a y " ; a $ " y o u d o n t l o o k " ;
b " y e a r s o f a g e " [ E N T E R ]
There are 3 mistakes in the above program:
In line 5 we typed in clss instead of cls .
In line 10 we typed in you instead of you r .
In line 30 we forgot to put a space between say and the quotation marks " .
There are 3 methods of editing a program. The first is to simply type in the new line again. When a
line is retyped and entered it replaces the same numbered line currently in the memory, Secondly,
there is the edit method and finally there is the copy cursor method.

EDIT METHOD

To correct the mistake in line 5, type:
e d i t 5 [ E N T E R ]
Line 5 will then be printed with the cursor superimposed over the 5. To edit out the extra s in clss,
press the cursor right key [+] until the cursor appears over the last s , then press the [CLR] key. You
will see the s disappear. Now press; [ENTER] and line 5 will now be corrected in the memory. Type
in:
l i s t [ E N T E R ]
to check line 5 is now correct.

COPY CURSOR METHOD

To correct the mistakes in line 10 and 30, hold down [SHIFT] key then press the cursor up key [ t ]
until the copy cursor is positioned over the very beginning of line 10. You will notice the main cursor
has not moved, so there are now two cursors on the screen. Now press the [COPY] key until the copy
cursor is positioned over the space between you and name. You will notice that line 10 is being re-
written on the last line and the main cursor stops at the same place as the copy cursor. Now type in
the letter r . This appears on the bottom line only.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents