Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-04 - 43,50334/tops8s.gno
There are no other files named tops8s.gno in the archive.
%switch qz false
%if qz
%nocontrolc
%nextlesson pub("TOPQ");
%ifend qz
%algol COMMENT warning VIDED may destroy altmodes!;
START:
%init
begin external procedure echo,pub,r;
external integer procedure tinput;
integer procedure Cinput(visible);
boolean visible;
begin integer c; echo(0,2); c:=tinput;
  if visible then echo(0,0);
  if c>=97 and c<=122 then c:=c-32;
  if visible then begin
    outsymbol(c);
    breakoutput;
  end;
  Cinput:=c;
end;
%algend
%TEXT t0:
The find command.
=================

In SOS you can locate an arbitrary text string within a file
without specifying the line number.
You do that with the FIND command. 
It is written as the letter "F" followed by the text string
you want to find. Push the ALTMODE or ESCAPE key and then
the RETURN key.

%question ESCkey:
Do you know which key is the ESCAPE key?
%noextra
%neutral yes
%goto findcomm;
%neutral y
%same
%neutral no
%goto esctext;
%neutral n
%same
%wrong
Answer yes or no!
%goto ESCkey;
%text esctext:
A very important key on your keyboard is the ESCAPE or ALTMODE key.
This is used all the time by SOS.
If the ESCAPE key does not work, or if there is no such key,
you could sometimes push CONTROL-# instead, that is simultaneously
pushing the CONTROL and "#" key on your terminal. On other
terminals you should use CONTROL-[ or CONTROL-$ to get ESCAPE.
If nothing works, please consult your local system manager.

The ESCAPE character is not printable. Therefore, in this
lesson it will be printed as $. Wherever the $ character occurs
in this lesson, it does not really mean $, it means ESCAPE.
%QUESTION printESCAPE:
Push the ESCAPE key!
%RIGHT 
%wrong stop
Write "%" if you want to stop.
%extra
%wrong $
Type the ESCAPE key, not the character it will be printed as.
%wrong [
%same
%wrong #
%same
%wrong ESC
Push the ESCAPE key. Do not type the whole word ESCAPE.
%wrong CONTROL
Push the CONTROL key and another key. Don't type the
word CTRL or CONTROL or the character "^"!
%wrong CTRL
%same
%wrong ^
%same
%WRONG
%wrong
%WRONG
Your terminal and the computer probably do not quite understand
each other. This may be remedied by the tty command, ask someone
about it.
%GOTO printESCAPE

%text findcomm:
EXAMPLE: FPROBLEM<escape><return>
will search for the first occurrence of the text "PROBLEM"
starting from current line.
(Current line is the line last written on your terminal.
When opening a file for editing, it is the first line.)

Sometimes I will put brackets ("<",">") around text to make it
easier to read. This does NOT mean that you should
type the brackets. For example, if the text says <escape>,
you should of course push the ESCAPE key on the keyboard.

%text t1:
It is also possible to search through a range of line numbers
for the first occurrence of a given text string.

EXAMPLE: FSOLUTION<escape>  500:1000 <return>
will search for the first occurrence of "SOLUTION" in lines
500 up to and including 1000.

When the text string is found, the text and the line number
will be printed by SOS.
If the specified text does not exist within the given range
SOS will indicate that by typing  %SEARCH FAILS.

%question
What do you type if you want to find the first occurrence
of the text "SIMULATION" in a given file, using the FIND command?
%order
%noextra
%right FSIMULATION ^ : *
%right FSIMULATION 1 : *
I did not expect that answer, although it is a correct command
in SOS. It is often better to use "^" for the first line.
%right FSIMULATION 0 : *
%same
%right fsimulation bf : *
%same
%right fsimulation 0 : ef
%same
%right fsimulation 1 : ef
%same
%right fsimulation ^ : ef
%right fsimulation bf : ef
%right fsimulation ef
%extra
%WRONG F SIMULATION  * :
You typed the range specification backwards.
%noextra
%WRONG F SIMULATION 
That command will search for the text "SIMULATION" starting
from CURRENT line. Use "^" and "*" to represent the first
and last line.
%extra
%wrong <
Do not type "<" or ">". Just push the ESCAPE and RETURN key.
%wrong "
Do not type the quotation marks.
%wrong FIND
The FIND command is typed "F".
%lack F
Use the FIND command
%lack SIMULATION
You did not type SIMULATION. It should be typed on
the same line as the "F" command.
%lack 
You must press the ESCAPE key after SIMULATION to indicate
that the text string is ended.
%lack ^
Use the "^" to represent the first line.
%lack *
Use "*" to represent the last line.
%lack :
Use the ":" to separate the first and the last line.
%wrong
%wrong
%goto t0
%question q1:
Do you want to have another question on the FIND command ?
%neutral yes
%goto q3
%neu y
%same
%neutral no
%goto t2a
%neu n
%same
%extra
%neutral
Answer yes or no.
%goto q1
%question q3:
Type the shortest command to find the first occurence of "DEC10"
starting from current line.
%noextra
%order
%right fdec10 
%wrong fdec10 . : *
It is not necessary to specify the lines.
The command FDEC10<escape> <return> is sufficient.

%wrong f dec 10   .
No, that command will look for DEC10 only at
the current line.
%extra
%wrong :
You need not specify any lines in this case.
Just push <return> after <escape>.
%wrong *
%same
%wrong ^
%same
%wrong .
%same
%wrong ef
%same
%lack f
Use the FIND command.
%lack     
Use the ALTMODE or ESCAPE to indicate that the text string
is ended.
%wrong "
Do not type the quotation marks!
%lack DEC10
You did not type DEC10.
%wrong
A hint: First the "F" command, then the text string you want to
find ended with ALTMODE or ESCAPE.
%wrong
%goto t0
%text t2a:
After you have found an occurence of of the string, you may
continue the search by just typing F<return>, without any
search string or range.

example:  
           
FNEW<escape> 100:500 <return>            Search for the first occurrence
00150  T:-NEW POINT;                     of NEW in lines 100 trough 500.

F<return>                                Search for the next occurrence
00200  U:-NEW LINE;                      of NEW after line 150 and upto
                                         line 500.


(The line number and the text are printed by SOS.)

%text t2:

The Substitute command.
=======================

Sometimes the same string of text occurs frequently in a file.
It would be very tiresome to change every line one by one.
SOS provides a SUBSTITUTE command, written "S", that will substitute
every occurrence of a text string for another in a specified range.

EXAMPLE:  S<old text><escape><new text><escape> 100:500 <return>
will substitute the old text for the new text in lines 100 upto 500.

%text
WARNING: Make sure that the old text only occurs at the places
you really want to change.
If you for example type the command  Sgo<escape>stop<escape> ^:*
the word Algol will be changed to Alstopl, which was probably not
your intention.

If no range is included in the command, only the first
possible substitution after the current line will be done.
This is analogous to the F command without a range.

%question q2:
What do you type, when using the substitute command, if you
want to change the word ALGOL to SIMULA in lines 1000 up to 2000 ?
%extra
%order
%right salgolsimula 1000 : 2000
%algol extratest;
%wrong s simula  algol   1000 : 2000
You have typed SIMULA and ALGOL in the wrong order.
%wrong substitute
The SUBSTITUTE command is written "S".
%wrong s   
You should only press the ESCAPE or ALTMODE twice.
%lack s
Use the "S" command.
%lack 
Press the ALTMODE or ESCAPE after each text string.
%lack    
You have to use the ALTMODE or ESCAPE twice.
%lack ALGOL
You did not type ALGOL.
%lack SIMULA
You did not type SIMULA.
%lack 1000
The first line number is 1000
%lack :
Use a colon to separate the line numbers.
%lack 2000
The last line number is 2000.
%wrong
A hint:
First the "S" command and the text you want to substitute ended
with a push on the ESCAPE or ALTMODE.
Then the new text, also ended with ESCAPE or ALTMODE.
%wrong
%goto t2
%question
For which line(s) will substitution be done, if you 
do not specify any line number?
%noextra
%order
%right current
%right current line
%right current.
%right current line.
%right for current line
%right for current line.
%right in current line
%right in current line.
%right at current line
%right at current line.
%extra
%right current
%right same
%right present
%right last written
%right last printed
%right last typed
%right latest printed
%right latest typed
%right latest written
%right now line
%right this
%right .
%right own
%extra
%wrong FIRST
%wrong last
%wrong all
%wrong :
%wrong .
%wrong ef
%wrong ^
%wrong *
%wrong
%wrong
Substitution will only be done for CURRENT line.
%goto q3a
%question q3a:
Do you want another question on the substitute command ?
%neutral no
%goto t5
%neu n
%same
%neutral yes
%goto next
%neu y
%same
%extra
%neutral
Answer yes or no
%goto q3a
%question
Give the command for substitution of DIFFICULT to EASY from the
beginning of the file up to current line.
%noextra
%order
%right sdifficulteasy ^ : .
%right sdifficulteasy 1 : .
I did not expect that answer, although it is a correct command.
It is often better to use "^" for the first line.
%right sdifficulteasy 0 : .
%same
%right sdifficulteasy bf : .
%same
%extra
%wrong . :
You typed "." on the wrong side of ":".
%wrong s easy  difficult 
You have typed EASY and DIFFICULT in the wrong order.
%wrong *
"*" specifies the last line.
%wrong ef
"EF" specifies either the last line or the whole file.
%wrong   
You should only press the ESCAPE or ALTMODE twice.
%lack difficult
You did not type DIFFICULT.
%lack EASY
You did not type EASY.
%lack sd
Use the "S" command.
%lack ^
Use the "^" to represent the first line.
%lack :
Use a colon to separate the lines.
%lack .
Use "." to represent current line.

%lack    
Use the ALTMODE or ESCAPE  after each text string.
%wrong
First you type the "S" command. Then the text strings ended with
ALTMODE or ESCAPE.
%wrong
Time to repeat  the SUBSTITUTE command.
%goto t2
%text t5:
The Alter command. (Intraline editing mode.)
============================================

The ALTER command is used for small changes within a line.
The command, written "A", places the user in a special editing
mode which has its own commands.
To enter ALTER mode you type "A" followed by a line number.
This mode uses a pointer within the line.
Think of the pointer as pointing between two characters on
the line. Initially it points before the first character on the
line. The special commands will affect characters in the
immediate vicinity of this pointer.
%question
Give the command to enter ALTER mode at line 500.
%extra
%order
%right A 500
%algol extratest;
%wrong 500 A
First the "A" command, then the line number.
%wrong alter
The alter command is typed "A".
%lack A
Type "A" followed by the line number.
%lack 500
Type the line number after the "A" command.
%wrong "
You must not type the quotation marks.
%wrong
%goto t5
%text t6:
The special commands in ALTER mode are:

Moving the pointer.
-------------------
To advance the pointer one position to the right, strike
the space (blank) bar once. Each character in the text will 
be printed out, one by one, as the pointer moves forward.
This command may be preceded by an optional integer <n>. The command
will then be repeated <n> times. For example, if you want to move
the pointer 7 steps to the right you type "7 ".

Syntax: <n><SPACE>
%text
To move the pointer to the left, use RUB OUT.
This will not delete anything as it would do in ordinary
SOS mode. You can also use DELETE, BACKSPACE or CONTROL-H.
As the pointer moves backwards, the characters passed over
are surrounded by backslashes (\...\).
This command may be preceded by an integer in the same way as
the previous command.

Syntax: <n><RUB OUT>

To move the pointer back to the beginning of the line beeing
edited, type "B".

Syntax: B
%question
Push the key you use in ALTER mode to move the pointer one step
forward. (End the answer by pushing the RETURN key.)
%algol
If answerlength = 1 and answer.[1]=32 then
begin rightmessage; goto  next;
end;
If answerlength>1 then 
begin write("You pushed more than one key before RETURN.[N]");
wrongmessage; goto repeat; end;
%wrong
Push the space bar.
%wrong
%goto t6
%text t7:
The delete command.
-------------------
To delete one character, move the pointer to the position just before
the character and press the "D" key.
The deleted character will be surrounded by double backslashes "\\".
The delete command can be preceded by an integer. For example, if you
want to delete 7 characters, you can type "DDDDDDD". You can also do
it by typing "7D".

Syntax: <n>D
%text
The insert command.
-------------------
Move the pointer to the place where you
want to insert your text. Press the "I" key.
You can now insert any text you want starting from current position.
To indicate that the inserted text is ended, you push the 
ALTMODE or ESCAPE key. Afterwards, the pointer will be pointing
after the inserted text.
"<string>" means the string you want to insert.

Syntax: I<string><ESCAPE>

If you have made an insertion and want to finish ALTER mode
immediately, then you can push RETURN without pushing ESCAPE first.

The "I" command has a special feature to split up a line: If you
type "I", then LINE FEED and RETURN, the current line will be
split up at the pointer, which will be positioned at the beginning
of the new line.
%text
Terminating command.
--------------------
When no more editing is necessary, you should push the 
RETURN key. This causes the rest of the line to be printed.
It also ends the ALTER mode.
%question alteruse1:
Assume that line 200 in your text is:
00200   SIMULA BEGIN
How do you use the ALTER command to change this line to
00200   SIMULATION BEGIN
with minimum number of key pushes?
Use only the commands you have learnt so far.
%noextra
%order
%neutral a 200
%algol
begin integer c;
  procedure wrong(t); string t;
  begin if c = carriagereturn then c:=tinput;
    echo(0,0); newline;
    if skip then begin skip:=false;
      Write("Question skipped[N]");
      pause; goto alteruse2 end;
    wrongmessage; write(t); newline;
    goto alteruse1;
  end;
  echo(0,2);
  write("00200   "); breakoutput;
  c:=cinput(false); if c # "6".[1] then wrong(
  "First type the number of steps you want to move the pointer.");
  c:=cinput(false);
  IF c # " ".[1] then
  wrong("You forgot to push the space bar.");
  write("SIMULA");breakoutput;
  c:=cinput(false);
  IF c # "I".[1] then
  wrong("Use the INSERT(I) command.[N]");
  c:=cinput(true); IF c # "T".[1] then wrong("T expected");
  c:=cinput(true); IF c # "I".[1] then wrong("I expected after T");
  c:=cinput(true); IF c # "O".[1] then wrong("O expected after I");
  c:=cinput(true); IF c # "N".[1] then wrong("N expected after O");
  echo(0,2);
  comment 27 = ASCII code for escape;
  c:=cinput(false); IF c = 27 then c:=cinput(false);
  IF c # carriagereturn then wrong(
  "You should have pushed the RETURN key after ""TION"".");
  c:=cinput(false);
  WRITE(" BEGIN[N]"); breakoutput;
  echo(0,0);
  end;
rightmessage; goto next;
%algend
%extra
%wrong al
The ALTER command is written with the single letter A.
%lack a
Use the ALTER command.
%lack 200
The line to be altered had number 200
%wrong 02
You may have leading zeroes in your commands, but they
will be shorter if you omit the zeroes.
%wrong
Type nothing except the A and the line number
%wrong
Type just A200 and then push the carriage return key
%question alteruse2:
Assume that line 999 in your text is:
00999   SIMULATION BEGIN
How do you use the ALTER command to change this line to
00999   SIMULA BEGIN
with minimum number of key pushes?
%noextra
%order
%neutral a 999
%algol
begin integer c;
  procedure wrong(t); string t;
  begin if c = carriagereturn then c:=tinput;
    echo(0,0); newline;
    if skip then begin skip:=false;
      Write("Question skipped[N]");
      pause; goto t8 end;
    wrongmessage; write(t); newline;
    goto alteruse2;
  end;
  echo(0,2);
  write("00999   "); breakoutput;
  c:=tinput; if c # "6".[1] then wrong(
  "First type the number of steps you want to move the pointer.");
  c:=tinput;
  IF c # " ".[1] then
  wrong("You forgot to push the space bar.");
  write("SIMULA");breakoutput;
  c:=tinput; if c # "4".[1] then wrong(
  "First type the number of characters you want to delete.");
  c:=cinput(false);
  IF c # "D".[1] then
  wrong("Use the DELETE(D) command.[N]");
  write("\\TION"); breakoutput;
  c:=tinput;
  IF c # carriagereturn then wrong(
  "You should have pushed the RETURN key after ""4D"".");
  c:=tinput;
  write("\\ BEGIN[N]"); breakoutput;
  echo(0,0);
  end;
rightmessage; goto next;
%algend
%extra
%wrong al
The ALTER command is written with the single letter A.
%lack a
Use the ALTER command.
%lack 999
The line to be altered had number 999
%wrong 09
You may have leading zeroes i your numbers, but the command gets
shorter if you don't.
%wrong
Type nothing except the A and the line number
%wrong
Type just A999 and then push the carriage return key
%text t8:
Another way to move the pointer in ALTER mode is to use the SKIP command.

The skip command.
-----------------
This command will move the pointer to just before the next
occurence of a specified character in the line.
It is written "S" and followed by that character to which you want 
to move the pointer. If the "S" is preceded by an integer <n>,
SOS will look for the <n>:th occurence of the specified character.

Syntax: <n>S<character>

%text t9:
EXAMPLE: Suppose you have the line

00200    A = B + C +

with the pointer before A.
If you give the skip command "2S+", SOS will type

00200    A = B + C 

and put the pointer before the second "+".
You can now continue and give the delete command "D".
Push the RETURN key and you will get the result:

00200    A = B + C

%question q10:
Give the skip command to get the pointer to point between "D" and "E"
instead of before "A" in the line below.
00500    ABCDEFGHIJ
%noextra
%order
%right SE
%right 1SE
%neutral A 500
We are already in ALTER mode. Just give the SKIP command.
%goto q10
%wrong S A
This command will not move the pointer.
%wrong S D
This command will move the pointer to just before the "D".
%wrong S F
This command will move the pointer to just before the "F".
%extra
%wrong s e
Don't type any spaces between the S and the E.
%lack S
Use the SKIP ("S") command.
%lack e
After S you type the character to which you want to move the
pointer.
%wrong
A hint:
Use the "S" command in ALTER mode followed by the character
to which you want to move the poiner.
%wrong
%goto t9
%text
The print command.
------------------
If you have made several corrections in alter mode, the line
might look "dirty" with a lot of backslashes on the screen.
If you type "P", the line will be reprinted up to the pointer's
position.

Syntax: P

%text
The replace command.
--------------------
You type "R", and then a string ended with ESCAPE. The replace
command will then delete one character and put in the string at
the pointer. If you want to delete more than one character, you
can type the number <n> before you type "R". The replace command
works exactly as <n>DI<string><ESCAPE>, that is the delete and
insert commands combined.

Syntax: <n>R<string><ESCAPE>

%text alteruse3:
Suppose you have the text

04711	(TECO TERROR)

Use the replace command to change it to

04711	(LISP TERROR)

When you have typed the replace command, also type the
"P" command to see the line. Try to minimize the number of
key pushes.

%algol
begin integer c;
  procedure wrong(t); string t;
  begin if c = carriagereturn then c:=tinput;
    echo(0,0); newline;
    wrongmessage; write(t); newline;
    goto alteruse3;
  end;
    if skip then begin skip:=false;
      pause; goto tm1 end;
  echo(0,2);
  write("04711[T]"); breakoutput;
  c:=tinput;
  if c = " ".[1] then begin
    write("("); breakoutput;
    c:=tinput;
    if c # "4".[1] then wrong(
    "Type the number of characters you want to delete.");
    c:=cinput(false);
    if c # "R".[1] then wrong(
    "Use the ""R"" command.");
    write("\\TECO"); breakoutput;
    c:=cinput(false);;
    write("\\"); breakoutput;
  end
  else begin
    if c # "5".[1] then wrong(
    "Type the number of characters you want to delete.");
    c:=cinput(false);
    if c # "R".[1] then wrong(
    "Use the ""R"" command.");
    write("\\(TECO"); breakoutput;
    c:=tinput;
    if c # "(".[1] then wrong(
    "You must retype the paranthesis you deleted.");
    write("\\("); breakoutput;
    c:=cinput(false);
  end;
  if c # "L".[1] then wrong("L expected.");
  write("L"); breakoutput;
  c:=cinput(true); if c # "I".[1] then wrong("I expected after L");
  c:=cinput(true); if c # "S".[1] then wrong("S expected after I");
  c:=cinput(true); if c # "P".[1] then wrong("P expected after S");
  echo(0,2);
  c:=tinput; if c # 27 then wrong(
  "Use ESCAPE to finish the text string");
  c:=cinput(false); if c # "P".[1] then wrong(
  "Use the ""P"" command to print the line up to the pointer");
  write(" TERROR)[N]04711[T](LISP"); breakoutput;
  c:=tinput;
  if c # carriagereturn then wrong(
  "You should have pushed the RETURN key");
  c:=tinput;
  echo(0,0);
  write(" TERROR)[N]");
end;
rightmessage;
%algend
%text tm1:
Undoing changes.
----------------
If you have made some corrections in alter mode which you
regret, you can get back the old version of the line by
typing CONTROL U. This command will also reposition the
pointer to the beginning of the line.

Syntax: <CONTROL U>

You can also use the quit command. It is written "Q" and works
as CONTROL U, but the "Q" command also terminates alter mode.
%question alteruse4:
Which command do you push to end alter mode and keep the line
in the same state as it was before you entered alter mode?
%noextra
%right Q
%right quit
%right quit command
%right the quit command
%extra
%wrong control u
This command undoes the changes but it will not end alter mode.
%wrong CTRL u
%same
%wrong ^ u
%same
%wrong RETURN
This will end alter mode but it will not undo the changes.
%wrong CR
%same
%wrong esc
ESCAPE ends text strings, not alter mode.
%wrong
Push the "Q" key.
%wrong
%goto tm1
%text
There will be no more questions on the ALTER command.
If you are going to use SOS you are recommended to get
used to this command. It can be very effective if you
use it correctly.
%text t10:
The number command.
===================

As you know, each line in SOS has a line number.
The increment in line numbers is 100 by default.
If you want to change this you can use the NUMBER command.
It is written "N" and followed by the new increment.
By only typing "N" you will get an increment of 100.

EXAMPLE:  If you want to renumber a file with a new increment
of 500, you type "N500"
(The first line will then get line number 500.)
%question
Give the shortest command to change the line numbers in the
file below

00060    line 1
00120    line 2
00130    line 3

to become

00200    line 1
00400    line 2
00600    line 3

%noextra
%order
%right n 200
%wrong n
By only typing "N" you will get an increment of 100.
%wrong n 200 , 60 : 130
It is a correct command but not the shortest.
%wrong n 200 , ^ : *
%same
%wrong n 200 , 60 : 130 , 200
%same
%wrong n 200 , ^ : * , 200
%same
%extra
%wrong :
You don't need to specify any lines.
Type the "N" command, and then the increment.
%wrong n100
No, this would give the increment 100, but you
wanted 200.
%wrong 02
You may have leading zeroes in your numbers,
but they get shorter if you don't.
%lack n
Use the "N" command.
%wrong 200 n
First the "N" command, then the increment.
%wrong ,
%same
%wrong number
The NUMBER command is written "N".
%lack 200
The increment is 200.
%wrong
The increment is 200.
%wrong
%goto t10
%text t11:
It is also possible to renumber only some of the lines in a file.

EXAMPLE:  N50,100:500
will renumber lines 100 through 500 with a new increment of 50.

%question
Give the shortest number command to renumber lines 5000 up to the end
of the file with the new increment of 10.
%noextra
%order
%right n 10 , 5000 : *
%right n 10 , 5000 : ef
%wrong n 10 , 5000 : * , 5000
It is a correct command but not the shortest.
%extra
%wrong /
You need not specify any pages.
%wrong , ,
Just type "N", the increment and the range specification.
%wrong 01
You may have leading zeroes in your numbers,
but they get shorter if you don't.
%wrong 05
%same
%wrong number
The number command is typed "N".
%lack N
Use the NUMBER ("N") command.
%lack 10
After "N" you type the new increment.
%lack ,
After the new increment you type a comma.
%lack 5000
The first renumbered line is 5000.
%lack *
Use "*" for the last line.
%lack :
Use ":" to separate the OLD lines.
%wrong n 10 , * : 5000 
After "N" you type the new increment.
%wrong N 5000 : * , 10
You have typed the command in the wrong order.
%wrong
A hint:
After the "N" command and the new increment, you type a comma
and a range specification.
%wrong
%goto t11
%text t12:
A more complete number command has the format:
    N<increment>,<old range>,<first number in new range>
where the arguments may be omitted from the right.
EXAMPLE:  N50,100:500,1000
will renumber lines 100 through 500 with a new increment of 50,
giving the first renumbered line the number 1000.
%question

Give the shortest number command for the file below
00001    line 1
00125    line 2
99999    line 3

to become

00200    line 1
00250    line 2
00300    line 3

%noextra
%order
%right N 50 , ^ : * , 200
%right n 50 , ^ : ef , 200
%right n 50 , 0 : ef , 200
%right n 50 , 1 : ef , 200
%right n 50 , bf : ef , 200
%right n 50 , ef , 200
%right n 50 , bf : * , 200
%right n 50 , 0 : * , 200
%right N 50 , 1 : * , 200
%wrong n 50 , 200 : 300 , 1
After the "N" and the comma you specify the OLD line numbers
you want to change.
%extra
%wrong 01
You may have leading zeroes in your numbers,
but they get shoter if you don't.
%wrong 02
%same
%wrong 05
%same
%wrong 99999
You could specify the last line in a shorter way than "99999".
%wrong n 200 , ,
After the "N" you type the new increment.
%wrong n 1 , ,
%same
%wrong * :
You probably typed the range specification backwards.
%wrong ef :
%same
%wrong number
The number command is typed "N".
%lack N
Use the NUMBER "N" command.
%lack 50
The increment is 50 and is typed after the "N" command.
%lack ,
Use a comma after the increment
%lack :
Use a colon to separate the first and last renumbered lines.
%lack , ,
You have to use a comma after the increment and after the 
range specification.
%lack 200
A hint:
The first renumbered line will have the new number 200.
%lack ^
Use "^" for the first line.
%lack *
Use "*" for the last line.
%wrong
First the increment, then the renumbered lines and last the 
number of the first renumbered line.
%wrong
%goto t12
%text t13:
To change the increment in line numbers that you get in INSERT mode,
you use the INSERT command followed by a comma and the new increment.

EXAMPLE:  I210,10
will start inserting at line 210 with the new increment of 10.

%question
Assume that you have the lines 500, 600, 700 ... and you want
to insert lines with line numbers 550, 560, 570.
Give the shortest possible insert command to do this.
%noextra
%order
%right i 550 , 10
%wrong i 10 , 550
After "I" you type the line number where you want to start inserting.
%wrong i 550
This command will start inserting at line 550 with current increment.
(Current increment = 100 if you do not specifies anything else.)
%extra
%wrong 05
You may have leading zeroes in the numbers,
but they get shorter if you don't.
%wrong 05
%same
%wrong insert
The insert command is typed "N".
%lack I
Use the insert "I" command.
%lack 550
After "I" you type the line number where you want to start inserting.
%lack ,
Type a comma between 550 and the increment.
%lack 10
The new increment is 10  (=560-550).
%wrong
First the "I", then the first inserted line number.
Type a comma and the new increment.
%wrong
%same
%wrong
%goto t13
%question q99:
Do you want to repeat this lesson ?
%neutral yes
%goto start
%neu y
%same
%neutral no
%goto endoflesson
%neu n
%same
%extra
%neutral
Answer yes or no.
%goto q99
%text summary:
Summary
=======

SOS Command		Effect
-----------		------
F<str>$m:n		Print the first line in the range m:n
			which contains tre string <str>.
F<str>$			Print the first line in the range
			current line:last line wcich contains <str>.
F			Look for the same string as in the last
			F command in the range next line:last line.
S<str1>$<str2>$m:n	Substitute all occurences of <str1> to <str2>
			in the range m:n.
S<str1>$<str2>$		Substitute in the range current line:last line.
S			Execute the last substitute command in the
			range next line:last line.
Nk,m:n,s		Renumber the lines m:n with new increment k
			and start at line s.
Im,n			Insert a line at line number m with new
			increment n.
An			Start ALTER mode at line n.

ALTER mode commands
-------------------
n<SPACE>	Move the pointer n steps to the right.
n<RUB OUT>	Move the pointer n steps to the left.	
nD		Delete n characters.
I<str>$		Insert the string <str> at the pointer.
<RETURN>	Make the ALTER mode changes permanent and leave ALTER.
nS<character>	Put the pointer to after the n:th occurence
		of the character.
P		Print the line up to the pointer.
nR<str>$	Delete n characters and put in the string <str>.
<CONTROL U>	Undo the ALTER changes and start again.
Q		Same as CONTROL U, but leave ALTER mode.
%algol pause; end;
%end