Commodore 2001-8 User Manual page 29

Table of Contents

Advertisement

numbers. Much of the data you want to work with in programs is not numeric but alphanumeric •• the way
we talk back and forth as human beings.
These characters are specified to the PET with literal strings. More specifically a literal is any value
contained within a set of quotes.
To allow the maximum composition of screen data, the PET has a special set of graphics characters and
the ability to store and execute cursor control characters which are fed to It by means of literals or other
more sophisticated techniques.
We have already discussed in a section on PET keyboard input how the PET stores its data in ASCII.
Graphics characters are stored as an extension to this set. Graphics are produced by shifting from the
original 64 character set and they are stored in memory with a special indicator to differentiate them from
the lower characters on the keys. A literal can be used to draw a line just as easily as it can be used to
print HI THERE.
Any combination of characters within the PET keyboard may be typed in as a literal and this includes all
cursor movement and the reverse field. PET has a special mode in the screen editor which assumes that
you are typing in a literal whenever a quotation mark is typed. From the time that the first quotation mark
is typed until the
t1"lP
that a closing quotation mark is entered, all characters are transferred directly to
the screen in a format so that the software which transfers the input line to BASIC will transfer them as
control characters if that is appropriate.
You can see the cursor movement characters flagged with reverse field within a literal. Type a single
quote and see this happen. Reverse field looks like an "R". Home is an "S" and clear is a shifted "S" or
heart. Cursor down Is a
"a"
and cursor up is the shifted
"a"
or hole character. Cursor right is a right
bracket and cursor left is the shift of that character and looks like a vertical line through the 5th column of
dots. Insert is a shifted "T" which looks like a second vertical line.
You cannot enter a character in reverse field into a literal but you can turn on reverse field with the control
character before your character is printed. The only characters that are allowed to appear in reverse field
between quotes are those which are interpretted as control characters.
Delete is the only editing character that will still work within a literal. Once an odd number of quotes has
been typed on a line, you lose the ability to move the cursor about the screen until either a closing quote
or a carriage return is typed.
You should note at least one time while you are editing that you have fallen into the aforementioned trap
of trying to move the cursor after a quote has been typed. EithM type a phoney closing quote or a carriage
return, then cursor up to edit your mistake.
Another method of inserting cursor control characters into already existing text is to use the insert
function. It has the same effect as an opening quote. For example, if you type insert three times and then
try to do a cursor movement, the control characters will be flagged with reverse field just as before. This
mode is easy to get out of because you need only enter as many new characters as the number of times
you struck the insert function. It is suggested that you make up your own examples to play with this.
Examples may also be suggested to you as you make a few editing mistakes.
The ability to readily manipulate the graphics and the cursor movement characters can allow whatever
depth of graphical capability you have the time and patience to program. The computer should be fun. We
recommend that you develop your own programming skills with the text and contlonually experiment
with the use of Imbedded graphics and cursor movement characters. Remember that you cannot hurt the
25

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pet 2001-8

Table of Contents