Commodore 2001-8 User Manual page 20

Table of Contents

Advertisement

decrementing the screenpolnter fr9m where you are by one and striking a blank over where the screen
pointer is. We can go back and erase the READY that is right. in .front of our cursor by just continuously
striking the delete key. Notice two facts as you are striking; (1) if you strike slowly, the cursor will move
one character at a time, and (2) if you strike fast, the cursor will actually move several characters
before you see it blink. This phenomenon occurs because it takes 15 times as long to blink 2 characters
as it does to overstrike one. Also, notice that 1.'he PET wraps around the screen. The screen memory is
organized so that deleting the previous character in memory moves the pointer back over that character.
Because of the fact that the characters scan from right to left in
40~01umn
chunks, for example deleting
the character at the beginning of the line, and then striking the delete key at the beginning of the line,
deletes the 40th character of the previous line. Just keying back 40 strokes erases the READY from the
line above, however, this is a pretty slow way of editing.
There are three cursor movement keys on your PET. One key moves the cursor right or left; the second key
moves it up and down, and the third key moves it home (upper left-hand corner) and clears the screen.
CURSOR RIGHT AND LEFT
The cursor right key mbves the pointer one character to the right. If we strike it now five times, you will
see that it moves us five columns over. It accomplishes this by changing the cursor pointer in memory.
The cursor left key is on the same key as the cursor right and is evoked by shifting prior to striking. If we
type that four times, you will see that now we are back one character to the right of where we started. If
we strike it two more times, it moves us around the corner of the previous line. Cursor left, of course, just
moves the cursor pointer one character less in memory. Going to the left, it moves one character at a
time. Obviously, by doing this, we are able to edit the screen. However, faster editing can often be
achieved by use of the cursor up and down keys.
CURSOR UP AND DOWN
The cursor down moves the pointer 40 columns to the right from its current position. This gives it the
same Visual effect as moving it down one line on the screen. For an example, try spacing over forty
positions with the cursor right. The cursor is now on the same position on the screen, but down one line.
To cause the cursor to move up, hold down the shift key while striking the cursor up/down key once; this
gets us back to our original position.
Cursor up moves the screen memory pointer "up" 40 characters from its current position, or rather, 40
characters less in screen memory than the current position.
SCREEN EDITING
We can now use the cursor movement characters to get up in position on the second H in the HI THERE
PET message. Once you are there, you can now delete the T by striking the delete key. You will notice that
all the characters t9 the right of the character being deleted are moved to the left one character. You will
now see the delete is actually a matter of mOVing all the characters in memory left one, rather than just
substituting a blank.
INSERTIDELETE
Before analYZing insert and delete, we should be reminded that the screen memory is organized such that
any single line may consist of 40 or 80 characters. (See section on screen memory.) Insert and delete are
concerned with the characters on a line. Whenever the delete key is struck, all of the characters,
starting from the position of the cursor, to the end of the line, are automatically shifted one character to
the left, replacing the character preceding the cursor. The cursor is then moved to the position of the
replaced character.
The last character in the line is automatically blanked. Insert is the reverse of this process, If we want to
15

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pet 2001-8

Table of Contents