There are no other files named tops8t.gno in the archive.
%switch qz false
Partitioning of text files into pages.
When you are using TECO to handle a large text file,
then you usually divide that file into pages. Each page should
contain less than about 50 lines of text.
When the file is printed, a new page is always printed at the top of
a new paper form.
You divide a file into pages by insertion of the special character
FORM FEED into the file. There is a key for that character on your
terminals and you can insert it just like any other character.
On some terminals, the FORM FEED key is labeled FF or ERASE PAGE.
Push the FORM FEED key on your terminal, and then push the RETURN key.
If answerlength = 1 and answer. = 12 then
begin rightmessage; goto next;
if answerlength > 1 then
begin write("YOU PUSHED MORE THAN ONE KEY BEFORE RETURN.[N]");
wrongmessage; goto repeat;
if answer. = linefeed then
write("You pushed LINE FEED instead of FORM FEED.[N]");
You forgot to hold down the CONTROL key while pushing "L"!
You pushed ESCAPE instead of FORM FEED.
You did not hit the FORM FEED key. Look for a key labelled
"FORM FEED" or "FF" or "ERASE PAGE". Make sure that you used
upper case if that character is upper case on the keyboard
of your terminal.
%algol if false then begin cantfind:
You seem to have trouble finding the FORM FEED key. Maybe you
are using a terminal which is not equipped with that key?
Do you want to try some more keys? Answer "YES"
if you want to, answer "NO" if you want to assume that your
terminal does not have any FORM FEED key!
Answer either "YES" or "NO"!
We will assume that your terminal does not have any FORM FEED
key. However, you can still use TECO. There is a special command
in TECO to insert characters which have no key on your terminal.
Instead, you use the decimal value of the character. The decimal
value of FORM FEED is "12". To insert that character into a file
you write the TECO command string "12I$". This command string
will introduce one character with a decimal value of 12, that is,
one FORM FEED character.
To divide a file into pages, you simply execute that command string
to insert FORM FEED characters into your file.
%algol goto panda; end;
To divide a text file into pages, you simply insert a FORM FEED
with TECO just as you would insert any other text into your file.
That is, you write the letter "I", you push "FORM FEED" and then
you push "ESCAPE" twice.
After a file has been divided into pages, all the TECO commands
you have learned so far will only work within one page.
Thus for example:
"J" will place the pointer at the beginning of the current page
(not at the beginning of the entire file),
"ZJ" will place the pointer at the end of the current page,
"S" will only search within the current page,
"T" will only print within the current page etc.
TECO commands for page handling.
This means that you cannot serach for, skip or delete
FORM FEED characters using the ordinary "S", "L" or "D"
commands of TECO.
There are instead special commands for this. The most important
ones are the "P" and the "A" commands.
"P" means move the pointer to the beginning of the next page
in the text file.
"A" means append the next page to the current page and remove
the FORM FEED between the two pages.
Write a TECO command string to print the first line of the
next page. Include the two final ESCAPE-s.
You could also have written "PT$$" to get the same result.
You probably wrote "o" (the letter) instead of "0" (the zero digit).
There is no need to use the "L" command.
"T$$" will print the first line of the next page. First just
use the "P" command to get to that line.
"T" will print the first line, so after "T" just push ESCAPE
twice to finish the command string to TECO.
After "P" you are at the beginning of the next page, and
you only have to use the "T" command to print
the first line of it.
A hint: First use the "P" command to get to the beginning
of the next page, then use the "T" command to print the first
line of that page.
Maybe you should repeat reading the text about the "P" and "T"
%QUESTION ! a command;
Which TECO command is used to remove a page dividing FORM FEED
from the file?
Just write the single command letter and nothing else in answer to
The P command will move the pointer to the next page, but that
command will not remove the FORM FEED between the two pages
from the file.
The "I" command is used to insert things into a file, not remove
The "D" or DELETE command cannot be used to remove FORM FEED
Remember that by removing a FORM FEED you are a p p e n d i n g
Time for some repetition.
Searching from page to page.
The search command ("S") will only work within the current page.
If the string you are looking for is on the next page, the search
will not succeed.
There is therefore the "N" command which continues searching over
The "N" command is used exactly as the "S" command.
There is also a "FN" command corresponding to the
"FS" command but searching over page boundaries.
%QUESTION ! NLOVE;
Write the shortest TECO command string which will search
across page boundaries for the word "LOVE" and print the first
line found with that word in it.
That was correct but might cause trouble if you try to use the
command sequence several times in succession. Since you move the
pointer back before "LOVE" you will find the same line several
Try to find a solution which does not use the "L" command, only
the "N" and the "T" command, so that the command string can be
used several times in succession to find different lines with
the word "LOVE" in them.
You probably wrote "o" (the letter) instead of "0" (the zero digit).
Use the "N", not the "FN" command.
"T" will only print the part of the found line after the word
"LOVE". To print the whole line, use "0TT".
After "NLOVE$" you write "0TT" to print the found line.
Use the "N" command, since the "S" command will not skip over
You forgot the ESCAPE after "NLOVE".
A hint: first use the "N" command to find the word
"LOVE" and then use the "T" command to print the found line.
%QUESTION ! FNHATE;
Write the shortest TECO command string which will search in
the text file, skipping page boundaries if necessary, until
the word "HATE" is found, and then changing the first occurence
of the word "HATE" for the word "LOVE".
You forgot the final ESCAPE after "LOVE".
The format of the "FN" command is
"FN...SEARCH STRING...$...SUBSTITUTE STRING...$".
You forgot the ESCAPE after "FNHATE".
After "FN" you write the string to search for, that is, "HATE".
Use the "FN", not the "N" command.
The "S" and "FS" commands will not skip
across page boundaries. Exchange "N" for "S".
A hint: use the "FN" command to find "HATE" and replace it with
You are not using the FN command. Don't you like it?
Are you angry with me? I am sorry if I have been rude to you.
Avoid too large pages.
A warning: if your file contains too large pages, or if it does
not contain any page boundaries, then TECO will automatically
assume invisible page boundaries at regular intervals in your text.
Thus you may unexpectedly find that a search with an "S" command
will not succeed. In that case, either use the "N" command or
use the "P" command to get to the next page and then use the
"S" command to search within that page.
This difficulty will not occur if you divide
your file into small enough pages.
Moving to a previous page.
If you are on one page, and want to move to the next page,
you just use the "P" command. Moving backwards to previous
pages is more difficult.
The simplest way to move backwards is to leave TECO and
then enter TECO again at the beginning of the file. You do
this by first writing "EX$$", then waiting until you get
to the monitor, and then writing "TECO" to get back to TECO
It is anyway always good practice to perform this operation of
leaving and entering TECO now and then, since if there is
a machine failure, you may lose everything that
you did since the last time you entered TECO.
TECO Command Effect
I<form feed>$ Insert a page mark
P Move the pointer to the next page
A Append the next page and remove the page mark
nN<str>$ Search for the first occurence of the string
<str> over page boundaries
nFN<str1>$<str2>$ Substitute the n:th occurence of <str1> to
<str2> and look over page boundaries.