Trailing-Edge
-
PDP-10 Archives
-
decuslib10-04
-
43,50334/tops05.gno
There are no other files named tops05.gno in the archive.
%switch qz false
%if qz
%nextlesson pub("TOPQ");
%nocontrolc
%ifend qz
%TEXT
This lesson was written by Bo Tarras-Wahlberg and Jacob Palme,
FOA 1, S-104 50 Stockholm 80, Sweden.
Text editing.
============
If you want to create a text file from a terminal, if you want to
look at a text file or if you want to edit a text file, then you
need a text editor. The text editor is a program to help you look at
selected parts of a text file, change selected parts of the file or
put in new text where you want in the file.
%TEXT TWOEDITORS:
The most wellknown text editors on the DEC 10 are SOS, TECO and VIDED.
SOS requires line numbers, and uses these for reference. But
you also have the ability to search for and replace small string
portions of a line. It is also possible to put a frequently used
sequence of commands into a file which, when called, will perform
the commands. SOS has very many usuful commands. Although SOS
has many commands, you can easily learn a useful subset of them.
%TEXT
TECO is a context editor. This means that you find the place to act
upon in a text by giving a search string. TECO will then search
through the text until a portion is found which is identical to the
search string. TECO also allows you to write small routines (written
in TECO) to perform complex editing operations. TECO is thus not
only an editor, but also a simple programming language for text
editing.
%TEXT
VIDED is a display editor. It can only be used with certain kinds
of display terminals. The idea with VIDED is that the full screen
shows a section of the text being modified, and that the screen
content is modified after each edit operation to show the text
after editing. VIDED is especially suited to the editing of texts
in ordinary language, tables, figures, nicely structured programs.
VIDED works best if the line between computer and terminal has a
speed of at least 120 characters/second.
%QUESTION comment three editors;
Which are the three most wellknown text editors on the DEC 10?
%EXTRA
%NOORDER
%RIGHT TECO SOS VIDED
%NEUTRAL REPEAT
%GOTO TWOEDITORS
%WRONG TECO SOS
TECO and SOS was right, but there is one more editor.
%WRONG TECO VIDED
TECO and VIDED was right, but there is one more editor.
%WRONG VIDED SOS
VIDED and SOS was right, but there is one more editor.
%wrong teco
You have only named one of the three.
If you absolutely cannot remember the names
of the other two, then answer the
question with the word "REPEAT".
%wrong VIDED
%same
%wrong SOS
%same
%WRONG
%WRONG
%GOTO TWOEDITORS
%QUESTION comment line editors;
One of the three editors is a line editor, that is the place in
the text to act upon is found by its line number. Which is the one?
%right stopgap
%RIGHT SOS
%wrong stop
Write "%" if you want to STOP.
%wrong repeat
Write "%" if you want to back in the lesson.
%WRONG TECO
TECO is not primarily a line editor, although it can handle texts with
line numbers in them.
%WRONG VIDED
VIDED is not primarily a line editor, although it can handle texts with
line numbers in them.
%WRONG "%"
You should not write the quote characters ("). Just write %
%WRONG
%WRONG
Answer with one of the three editors TECO, SOS or VIDED!
%GOTO NEXT
%QUESTION comment the context editor;
Which of the three editors are mainly context editors, that is you
find the place to act upon by looking for a search string in the
text?
%RIGHT TECO VIDED
%wrong repeat
Write "%" if you want to back in the lesson.
%WRONG SOS
SOS can handle context editing, but is mainly a line editor.
%WRONG TECO
Yes, TECO is a context editor, but there is one more.
%WRONG VIDED
Yes, VIDED is a context editor, but there is one more.
%WRONG
%WRONG
Answers with one, two or three of the editors TECO, VIDED and SOS.
%WRONG
The correct answer is "TECO" and "VIDED".
%GOTO NEXT
%TEXT CREATE:
Creating new text files.
=======================
When you want to create a new text file using one of the editors,
%IF QZ
you type one of the monitor commands "SOS", "MAKE" or "RUN FOA:VIDED-"
"SOS" calls SOS, "MAKE" calls TECO, "RUN FOA:VIDED-" calls VIDED.
%IFNOT QZ
you type one of the monitor commands "SOS", "MAKE" or "R VIDED-"
"SOS" calls SOS, "MAKE" calls TECO, "R VIDED-" calls VIDED.
%IFEND QZ
%TEXT
%IF QZ
"SOS", "MAKE" and ".RUN FOA:VIDED-" like all other monitor commands
%IFNOT QZ
"SOS", "MAKE" and ".R VIDED-" like all other monitor commands
%IFEND QZ
must be given to the monitor, that is typed when the monitor types
a "." to you to indicate its readiness to accept your commands.
%TEXT
%IF QZ
After "SOS", "MAKE" or "RUN FOA:VIDED-" you must indicate the name of the
%IFNOT QZ
After "SOS", "MAKE" or "R VIDED-" you must indicate the name of the
%IFEND QZ
new file.
Example 1: If you want to create a LISP source program file for a
program called FIE, then you would type "MAKE FIE.LSP".
Example 2: IF you want to create a text file called LETTER.TXT,
%IF QZ
then you would type ".RUN FOA:VIDED-LETTER.TXT".
%IFNOT QZ
then you would type ".R VIDED-LETTER.TXT".
%IFEND QZ
%QUESTION comment the create command;
Assume that you want to use SOS to create a new Algol source
program which is to be called "PROG.ALG". What do you write to
the monitor then?
%NOEXTRA
%ORDER
%RIGHT SOS PROG . ALG
%WRONG SOSPROG . ALG
You must have a blank between SOS and PROG.
%right so prog.alg
%EXTRA
%WRONG MAKE
The "MAKE" command will call TECO, not SOS.
%wrong EDIT
The "EDIT" command is used to edit an old file, not to create
a new file.
%WRONG SOS
A hint: after "sos" just write the filename, a dot, and the extension.
%wrong so
%same
%WRONG . SOS
The initial dot(".") before "SOS" is written by the monitor,
not typed by you.
%wrong lined
You were asked to use "SOS" and not "LINED".
%wrong stop
Write "%" if you want to stop.
%WRONG "%"
You should not write the questionmarks. Just write %
%WRONG
Remember that the "SOS" command calls SOS and the "MAKE" command
calls TECO.
%WRONG
%SAME
%WRONG
Now it is time to repeat part of this lesson.
%GOTO CREATE
%TEXT EDIT:
Editing old text files.
======================
The "SOS" and "MAKE" commands were used to create new files.
If you want to look at or make changes or additions to an existing
file which you have stored away, then you would use the
"SOS" or "TECO" commands. (The SOS command "SOS" is used both for
creating new text files and for editing old text files.)
The "SOS" command calls SOS, the "TECO" command
calls TECO. After the word "SOS" or "TECO" you must give the
name of the file. If you thus want to use SOS to look at a file
called "XYZ.LSP", then you type "SOS XYZ.LSP" to the monitor.
%QUESTION comment the edit command;
What do you type to use TECO to look at an old file called "ABC.ALG"?
%NOEXTRA
%ORDER
%RIGHT TECO ABC . ALG
%WRONG TECOABC . ALG
You must have a space between TECO and ABC.
%wrong tecabc . alg
%same
%wrong teabc . alg
%same
%right tec abc . alg
%right te abc . alg
%EXTRA
%wrong make
The "MAKE" command is used to create new files, not to edit old ones.
%WRONG SOS
No, "SOS" calls SOS, not TECO.
%WRONG TECO
After TECO just write the filename, a dot, and the extension.
%WRONG
A hint: use the "TECO" command.
%WRONG
%WRONG
Now, it is time for some repetition.
%GOTO EDIT
%question if lasterrors > 0 then comment the teco command;
What do you type if you want to enter TECO to work on
an old file called "ABC.SIM"?
%noextra
%right teco abc . sim
%WRONG TECOABC . SIM
You must have a space between TECO and ABC.
%wrong tecabc . sim
%same
%wrong teabc . sim
%same
%right tec abc . sim
%right te abc . sim
%extra
%wrong te
After "TECO" just write the filename, a dot, and the extension,
just like when you created a file by typing "MAKE PROG.ALG".
%wrong so
The command "SOS" calls SOS, but not TECO.
%wrong mak
The command "MAKE" causes TECO to create a new file,
not edit an old one.
%wrong
A hint: use the "TECO" monitor command.
%wrong
%wrong
Time for some repetition.
%goto edit
%TEXT SUPERSEDE:
If you try to make a new file in TECO with the same name and extension
old one, then the old file would be destroyed. This might not be
what you intended. Therefore, you will get the error message
"SUPERSEDING EXISTING FILE".
When you get that error message, you can avoid destroying
the old file by immediately typing CONTROL-C.
%QUESTION comment leaving teco;
If you start creating a new file with TECO, and then type
CONTROL-C, will the new file be created then?
%EXTRA
%RIGHT NO
%right n
%WRONG YES
If you type CONTROL-C, then no new file will be created.
%WRONG
Answer either "YES" or "NO".
%question
What do you type if you want to enter SOS and work with an old
file called "ABC.SIM"?
%order
%noextra
%RIGHT SOS ABC . SIM
%WRONG SOSABC . SIM
You must have a space between SOS and ABC.
%wrong soabc . sim
%same
%wrong y
%same
%right so abc . sim
%extra
%WRONG make
The command "MAKE" causes TECO to create a new file.
%WRONG so
After SOS just write the filename, a dot and the extension.
%WRONG
A hint: use the "SOS" monitor command.
%WRONG
The right answer is: SOS ABC.SIM
%text
You must now decide whether you are going to learn TECO, SOS or
VIDED. The next four lessons in this course are different depending
on whether you want to learn TECO or SOS. There are at present no
lessons in this course on VIDED, you will have to read the manual
instead.
Here are the main advantages with the three editors:
%TEXT
TECO Allows the advanced programmer to write small text editing
programs directly in TECO. No problem with renumbering of the
lines, since there are normally no line numbers. TECO can however
also handle line-numbered files.
SOS Easier to learn and use for the beginner. Less easy to destroy
your files by mistake. Uses line-numbered files, and some
languages and on-line debugging systems work better with line-
numbered source files. Also possible to write series of commands.
VIDED Immediate feed-back of the results after each edit operation.
The screen always shows a segment of the text being edited.
Cursor control keys on display terminals can be used. Special
facilities for editing natural language texts like letters,
manuscripts etc. Can only be used on certain display terminals.
%if qz
%TEXT
All three editors are supported at the QZ computing Centre in
Stockholm, but SOS is recommended for ordinary programming language
text editing.
%ifend qz
%text summary:
Summary
=======
Command Effect
------- ------
SOS Create or edit a file with the SOS editor.
MAKE Create a file with the TECO editor.
TECO Edit a file with the TECO editor.
%IF QZ
RUN FOA:VIDED- Create or edit a file with the VIDED editor.
%IFNOT QZ
R VIDED- Create or edit a file with the VIDED editor.
%IFEND QZ
%END