TEACH TEACH                         Last revised, A.Sloman. Sept 1987
-- HOW TO READ POPLOG TEACH FILES -------------------------------------
The "TEACH" program uses an editor (word processor) called VED, which
displays text in 'teach files', and can be used to read, create, or
modify text files, like the one you are now reading.
[[[ NB. You will need to use the keyboard map for your terminal ]]]
[[[             Ask for help if necessary                       ]]]
Find the SCREENDOWN key (often marked with a downward arrow). Press it
twice. Don't hold down - press and release it immediately, twice to make
VED display the next portion of this file. Then press SCREENUP twice to
return. (The SCREENUP key is often marked with an upward arrow.) After
returning to the first portion, press SCREENDOWN twice to read on.

You have just learned your first TEACH commands - SCREENDOWN and
SCREENUP. As you will see, these move the "cursor" up and down or tell
VED to display the next (or previous) portion of the file, depending
on where the cursor was before you pressed the key.

Press SCREENDOWN once only to get the next portion of text

Press SCREENUP then SCREENDOWN alternately, several times. Watch the
'cursor' (a black or white oblong, depending on the sort of screen) move
up and down. If it is at the top of the "visible window", pressing
SCREENDOWN makes it jump to the bottom. If you press SCREENDOWN again,
it can't jump lower. Instead, more of the file is pulled up into the
window. Alternatively think of SCREENDOWN as pushing the window down to
show a different part of the file. Similarly, pressing SCREENUP
moves the cursor to the top of the window. But if it's already there,
SCREENUP gets the previous part of the file into the window.

Read on by pressing SCREENDOWN as needed. You can go back with SCREENUP.

Each time SCREENDOWN pulls the next portion of the file into the window,
the line that was at the bottom of the window is left at the top.

Be careful when pressing keys NOT to HOLD them down: let go quickly.
I.e. just tap the keys. If held down for more than about half a second
many keys will behave as if they are being pressed repeatedly. So
holding SCREENDOWN down may make VED move the cursor down many screens.
Read on, using the SCREENDOWN key. Use the SCREENUP and SCREENDOWN keys
as appropriate to read the rest of this file. Make notes as you go, to
help you remember what you read. Otherwise you are likely to forget.

-- DELETING CHARACTERS --------------------------------------------------

Type in a few words. You can correct errors one character at a time by
pressing the CHARDELETE key (often marked as DEL, though on some
keyboards as BS or Backspace). Try typing in some text below. Then press
the CHARDELETE key a few times. Read on with SCREENDOWN.



Try removing all your words then pressing the CHARDELETE key a few more
times - some of the TEACH text will disappear. Dont't worry! It's only
your own temporary copy of the TEACH file that's being deleted.

The text you see on the screen is a copy of a file held on a magnetic
disc attached to the computer. VED (the editor used by TEACH) treats all
TEACH files as 'write protected' so you won't mess up the file by typing
words (or deleting words) on the screen. Practice typing and deleting
text with the CHARDELETE key. Then read on.

-- THE COMMAND LINE -----------------------------------------------------

You may have noticed that above the text is a strange line containing,
among other things, a number. The strange line is called the 'command
line'. You can now learn to give commands using the ENTER key.

The number shown is the line of the teach file on which the cursor
currently is. If the cursor is on, say, the 71st line of the teach file,
then the number will be 71. Try pressing SCREENUP and SCREENDOWN a few
times and watch the number change.

The command line also reminds you of the name of the file you are
'examining'.

-- JUMPING TO A LINE IN THE EDITOR ------------------------------------

Make a note of the line number the cursor is now at (i.e. the number on
the command line), so that you can come back to it. You can use an ENTER
command to tell VED to go to another line, as follows. E.g. line 1 is
the beginning of the file. So you can go to the beginning of the file by
jumping to line 1 as follows. Find where the <ENTER> key is on your
keyboard, using the keyboard map if necessary.

    Press: <ENTER>     (Cursor goes to command line)
    Type:  1           (using the 1 key at the top of the keyboard above
                        the letters, not the 1 on the keypad on right.)
    Press: <RETURN>

When you have done that, repeat with different numbers, ending with the
number of the line you are on now, so that you can come back here.

-- LEAVING TEACH (AND POPLOG) -----------------------------------------

One of the important commands using the <ENTER> key is telling the
system that you wish to leave the editor, and Poplog. Read on a bit
first (up to the asterisks you'll find below). To leave the editor, and
Poplog, you

    Press: ENTER            (puts the cursor on the command line)
    Type:  bye              (the command you want to give)
    Press: RETURN           (that says go ahead and do it)

This will terminate the session using TEACH, and tell the operating
system that you have (for now) finished with Poplog. You will then be
talking to the operating system, which will give you its prompt, usually
either '$' or '%'. You can then give commands that the operating system
understands. E.g. you can log out. You may wish to practice doing that
if you are not familiar with the process. If you log in again you can
get back to reading the teach file by typing the same commands as you
previously typed to start reading it. You can then jump to the required
line number using the ENTER command shown you above.

NB after logging out, on some machines you'll have to press the <RETURN>
key once or twice to 'wake up' the computer, before you can log in
again.

Before you try all that, read on, a bit (till the asterisks, below).
When you log in after logging out, Poplog will not remember exactly what
you had been doing before. So you should make a note of the line number
you want to return to, so that when you log back in you can get back
here.

When you are ready to continue reading the teach file, type, to the
operating system:

    pop11

and press the RETURN key. You will then get the colon prompt telling you
that POP-11 is ready. You can then type

    teach

and press the RETURN key to get back to reading this file. After you
have logged in the whole sequence should look something like this:

    $ pop11                         (or % pop11)

    --- POP-11 prints a welcome message ---
    Setpop

    : teach

That will tell TEACH, to get this file back for you to read. Then use the
<ENTER>(line number)<RETURN> sequence to get back to the line you want.
E.g. it may be something like:
    <ENTER> 130 <RETURN>

Now try leaving Poplog using <ENTER>bye (as described above). Then
practice logging out and logging in again (if you wish). Then come back
to POP-11 then to TEACH then to this line. (First use the SCREENUP key
to go back and re-read the instructions so that you are sure you know
what to do to get back here. Make notes to help you remember.)

        ********************************************************

-- REFRESHING THE WINDOW ---------------------------------------------

Use the keyboard map to find the REFRESH key. It can be used to
re-display the text on the screen. Occasionally, the text will become
jumbled. This could happen if the computer operators sent out a
broadcast message. Another possible cause of this might be someone
tripping over the power lead connected to your terminal. If this
happened, then your screen would go blank (and stay blank even when the
power was restored) until you tell the computer to 'refresh' the
contents of your screen. You can do this by pressing the button(s) which
cause a "refresh" - look at your terminal map. Try that now i.e.
pressing the buttons, not tripping over the power lead (the equipment
insurance may not cover that). In fact in some cases if the terminal
power supply is cut off the computer will think you have logged out, and
you will have to log in again after switching on.

NB on some terminals (e.g. Visual 55) you will have to press the REFRESH
key TWICE to make it work, since it is also used as a 'lead-in' key for
different combinations of keys. If you press it only once VED waits for
another key to see what you were leading it into. So try pressing
REFRESH twice if nothing happens the first time. On some computers there
may not be a REFRESH key. Instead you will have to press two separate
keys.

-- DIFFERENT SORTS OF KEYS --------------------------------------------

Several of the VED commands that you will learn require two or more keys
to be pressed. However, there are different kinds of multi-key commands.

Most keys send a signal to the computer when pressed. But some keys
don't do anything on their own. Rather they are held down to change the
effect of other keys. SHIFT is an example. If you hold it down (try it),
nothing happens. But if you press some letter keys while you hold it
down, capital letter appear on the screen instead of lower case letters.
Try pressing some letter keys with and without the SHIFT key held down.
Don't worry if the TEACH text gets messed about.

Another key that does nothing on its own is the CTRL key. You use it to
modify other keys. The effect varies according to how your computer has
been set up. For example, on most systems that run Poplog, pressing the
"C" key while CTRL is held down causes an "interrupt". You can try that
now. Since nothing else is happening to be interrupted, you should not
see any effect.

On some keyboards there is also a key marked "FUNCTION" or "META" or
"Convert Function". This key, like SHIFT is used to alter the function
performed by other keys. So pressing it alone will do nothing.

You will learn about the effect of these keys later on. The main point
for now is that these "modifier" keys (SHIFT, CTRL, FUNCTION) are the
only ones that are held down for any length of time. The ENTER key, the
ESC key (referred to later) the keys with arrows on, the 'key-pad' keys
etc. are not modifier keys, but send their own signals, so you don't
hold them down, but press them lightly once. A light "tap" will usually
suffice.

-- 'KEYPAD' KEYS ------------------------------------------------------

Sometimes, it is inconvenient for the cursor to move a whole screenful
if all you want to see is just one or two more lines. On the right hand
side of  many keyboards (e.g. VT100, Visual 55, SUN) is a 'Keypad'. In
Some terminals allow the keys on the keypad to be used for small moves
up down, left, right, or diagonally. On your keyboard map look for keys
marked CHARUP, CHARDOWN, CHARLEFT, CHARRIGHT, and perhaps CHARUPLEFT,
CHARDOWNRIGHT, etc. On some keyboards these are the keys with "arrows"
on them. On some they are the numbered keys on the keypad.

These keys can be used to move the cursor in small steps. Find the
CHARUP, CHARDOW, CHARLEFT and CHARRIGHT keys, and others that look as if
they might be concerned with cursor movement, and try them out. If there
is an "LF" key on your terminal you can try that too - it may have the
effect of NEXTLINE, i.e. take the cursor to the beginning of the next
line.

Warning: some inferior terminals have a numeric keypad but don't permit
it to be switched to send the special characters: they just send
numbers.

If your keyboard has a switchable numeric keypad, it may work something
like this (press CHARDOWN repeatedly till all 9 boxes are visible).
                                    ____________________________
Experiment by pressing the keys     |7   UP  |8   UP  |9   UP  |
and see how the cursor can be made  |   LEFT |        |  RIGHT | Can you put
to move in any of eight directions. |________|________|________| the cursor in
                                    |4       |5       |6       | box 5?
                                    |        |        |        |
If you move far off to the right,   |________|________|________|
text 'scrolls' or jumps left.       |1  DOWN |2  DOWN |3  DOWN |
Move the cursor left again, to      |   LEFT |        |   RIGHT|
bring it back.                      |________|________|________|


If you try to move the cursor up or down past the boundary of the
'window', the file 'scrolls' down or up, as if you were pushing the
window in the same direction as the cursor.

You'll find that if the cursor is at the left of the screen and you try
to move it further left, (using THE CHARLEFT key) then it will jump back
to the end of the previous line.


-- BIGGER JUMPS -------------------------------------------------------

If your keyboard has a key marked "FUNCTION" or "CONVERT FUNCTION" (e.g.
a Visual 55, or Visual 200) you can try holding it down at the same time
as you press one of the "move" keys. It should turn a small move to a
bigger move in most cases. But it depends on how the keyboard has been
set up: consult your keyboard map. On some terminals (e.g. the SUN) you
will have to press the <ESC> key and then the keypad key in order to get
bigger jumps. On some (e.g. VT100, VT200) you may have to first press
the REFRESH key then the "move" key.


--MOVING THE CURSOR A WORD AT A TIME ------------------------------------

Two of the keys are known as WORDLEFT and WORDRIGHT. Note how those two
keys make the cursor move about. See what happens if you press WORDLEFT when
the cursor is at the beginning of a line.

For now you can ignore the other keys on the Keypad, apart from ENTER,
which you'll use for putting the cursor on the 'command line' to give
special commands.

-- SCREENLEFT and TEXTRIGHT -------------------------------------------

These take you from one end of a line to another. The TEXTRIGHT key
takes the cursor to the right hand end of the TEXT on the current line.
That is normally more useful than SCREENRIGHT, which always goes to the
extreme right of the screen.

-- OTHER TEACH FILES --------------------------------------------------

There are many TEACH files on many different topics. You can temporarily
transfer to another teach file and then come back to this one, as
follows. There is a teach file called WINDOW, which will show you how to
enlarge the visible 'window' so that you can see more of the file at
once. (You may have been wondering about that.) To read it, do the
following:

    Press: <ENTER>
    Type:  teach window           (If you make a mistake use the DEL key)
    Press: <RETURN>

This will get you the TEACH WINDOW file. Try it, and obey the
instructions. When you have finished you can "quit" the file by giving
the command
    <ENTER> q <RETURN>


-- RE-DOING THE LAST COMMAND ---------------------------------------------

(N.B. read down to the next main heading before trying the instructions
in this section.)
After you've come back to this file, the command 'q' (the last command
you typed in WINDOW) will appear on the status line of this file. You
can get the command obeyed again, without re-typing, by pressing the
REDO key. (Find it on the keyboard map.)

If you press it, the command 'q' will be obeyed again and so you will
quit this file. You can come back here by typing 'teach' to POP-11 and
then jumping to this line. Try it. As you have found, ENTER q only quits
the current file. Since this TEACH file was the first one you entered,
it is the last to be left and so ENTER q from here takes you out of the
editor, and since there are are no files left, you will find that you
are talking to the POP-11 subsystem of Poplog, with its colon prompt.
(Things may have been set up so that you are then talking to Prolog or
Lisp.) You can get back to reading this file by typing "teach" in
response to the prompt (followed by RETURN). Then jump back to this
portion of the file using <ENTER> followed by the line number.

If you were looking at (or creating) a number of files, then typing
ENTER q (or pressing the REDO key) repeatedly would quit each file in
turn and get you back to POP-11.

You can now try pressing the REDO button then do teach teach and then
jump back to this section by using <ENTER> 310

-- ON NOT FORGETTING -----------------------------------------------------

You should make notes of all the important points concerning the use of
TEACH and check with your course tutor about any confusions. Here's a
brief list:

    Which keys are held down to modify others, and which send
        their own signals to the computer?
    How do you move the cursor about the teach file?
    What does the ENTER key do?
    What does pressing the ESC key then W do?
    What does ENTER q do?
    What does it do if there is only one file left?
    How do you get back from POP-11 to TEACH?
    How do you get the cursor onto line 73 of a file?
    How can you get the cursor to the top of the file?
    How do you expand the TEACH window?
    How do you 'refresh' your screen?
    How do you leave TEACH (and VED) and Poplog?
    How do you LOG OUT?
    Which keys move the cursor a word left or right?

You should now go on to read TEACH VED to find out how to use the text
editor to make your own files. But if you need a rest first (you
probably will!) you can log out now, and come back later. Next time, log
in as before, except that when you have got the POP-11 colon prompt you
should type

    teach ved

then press RETURN. In other words, you don't have to first go to POP-11
then type 'teach ved' to POP-11. You can type it direct to the operating
system after logging in.

Other files you could now read are:

    TEACH VED          - more on VED - learning to create your own file
    TEACH MARK         - learning to mark a range in a file
    TEACH LMR          - using "load marked range" in a program file
    TEACH VEDPOP       - using the editor to create POP-11 program files

For more advanced users only:

    TEACH TEACHFILES   - overview of TEACH documentation
    HELP  HELPFILES    - overview of HELP documentation


CONTENTS of this file are listed below.
You can go to any section by putting the cursor on one of the lines
below then doing:
    <ENTER> g <RETURN>

If you later type <ENTER> g <RETURN> you will come back to this index.

 -- HOW TO READ POPLOG TEACH FILES
 -- DELETING CHARACTERS
 -- THE COMMAND LINE
 -- JUMPING TO A LINE IN THE EDITOR
 -- LEAVING TEACH (AND POPLOG)
 -- REFRESHING THE WINDOW
 -- DIFFERENT SORTS OF KEYS
 -- 'KEYPAD' KEYS
 -- BIGGER JUMPS
 -- SCREENLEFT and TEXTRIGHT
 -- OTHER TEACH FILES
 -- RE-DOING THE LAST COMMAND
 -- ON NOT FORGETTING

--- C.all/teach/teach
--- Copyright University of Sussex 1987. All rights reserved. ----------
