TOPS-20 User's Guide
Chapter 5 Creating and editing files
This chapter describes:
The TOPS-20 Operating System allows you to create or change files by
using a system editor program. DIGITAL supports three editors for
TOPS-20: EDIT, TV, and EDT-20. Other editors which are not supported
by DIGITAL, such as EMACS and SED, may be installed on your system.
EDIT is a line-oriented editor. With a line-oriented editor, you can
change a line by referencing the line number, then substituting
characters, or by retyping the line. Some computer programming
languages use line numbers when giving error messages. Line numbers
are also used with some debuggers.
EDIT has an easy-to-learn and simple-to-use command language. You can
use EDIT effectively on either a hard-copy or video terminal.
You can use EDIT to create a program and enter it into a file. There
are two commands that call the EDIT program:
The following sequence shows how to use EDIT to create an ALGOL
program that calculates the square root of a number. (If ALGOL is not
available on your system, refer to Chapter 9, Producing And Running
Your Own Programs, and use the FORTRAN program for the examples).
If you already have a file with this name and type, the
generation number will not be 1. To change the filename,
press the ESC key; the editor (EDIT) prints an asterisk.
Type EQ (End and Quit), and press the RETURN key. The
system prints the @. You can then CREATE a new file with a
different filename and file type.
EDIT is fully described in the EDIT User's Guide and the EDIT
Reference Manual.
TV is a character-oriented editor. With a character-oriented editor,
you can change one or more characters in a line without retyping the
line.
TV has a more powerful command language than EDIT. With this command
language, you can accomplish complex editing functions with fewer
commands.
For the most effective use of TV, you should use a video terminal. TV
is described in the TV Editor Manual.
EDT is DIGITAL's standard text editor. It is available
on many DIGITAL operating systems, for example, TOPS-20,
VAX/VMS, RSTS/E, RSX-11M, and RSX-11M-PLUS. There are only
minor differences in the features of EDT found on each of
these operating systems.
EDT-20 has three editing modes: keypad, nokeypad, and line. Keypad
and nokeypad modes are character-oriented editors for use on video
terminals. Line mode can be used on either video or hardcopy
terminals but is best used with hardcopy terminals.
EDT provides many features that are not available in EDIT or TV. To
name a few, EDT has an on-line help facility, it is customizable, and
it allows you to work with several files during a single editing
session.
To learn how to use EDT on TOPS-20, refer to the EDT-20 Primer. For a
complete description of EDT-20 commands and functions, refer to the
EDT-20 Reference Manual. Once you have begun using EDT, the EDT Quick
Reference Guide is a summary of EDT commands and functions.
To run an editor, type the name of the editor (EDIT, TV or EDT) and
press RETURN. TOPS-20 also has three commands for running editors:
EDIT, CREATE and PERUSE. These commands run the editor that is
defined by the logical name EDITOR:. To determine your system's
definition of EDITOR: give the INFORMATION LOGICAL-NAMES command.
If the system definition of EDITOR: is not the editor you have chosen
to use, make your own definition of EDITOR: with the DEFINE command:
Because this command is only in effect until you LOGOUT, you should
place it in your LOGIN.CMD file so that it will take effect every time
you log in.
As you type your program, you may need to correct typing errors. You
can correct your program lines by typing CTRL/U or by pressing the
DELETE key.
When you type CTRL/U, EDIT responds with the number of the
line you just deleted. Retype the line, and press the return
key.
On some terminals, the DELETE key is labeled RUBOUT or
DEL.
Each time you press this key, you erase the last character
that you typed. When the system deletes a character, it
responds with the deleted character, followed by a backslash
for each deleted character.
Correcting a Mistake When You Make It -
Suppose that while typing the word READ, you press the
E key twice. If you notice your mistake right away,
you can erase the second E by pressing the DELETE key
once. The system responds by printing the deleted
character (E) and a backslash. You can then continue
typing the line.
Correcting a Mistake After You Make It -
In the example below, you notice that you misspelled
SQUAREROOT, after you typed the word OF. To correct
the error, delete the last six characters by pressing
the DELETE key six times. (A space counts as a
character.) You can then continue typing the line.
You CANNOT use the DELETE key to correct characters on a line
once you have pressed the RETURN key. The manual for your
editor explains how to correct errors on previous lines.
Section 2.7
describes other ways to correct typing errors.
You CAN use the DELETE key to correct mistyped TOPS-20
commands. If you incorrectly type LOGOUT, for example, but
notice the mistake before you press the RETURN key, you can
use the DELETE key to fix the error. Section 2.7.1 contains
further information about correcting commands with the
DELETE key.
5.1 Selecting an editor
5.1.1 EDIT
<ESC>
|
@CREATE (FILE)
<ESC>
|
@CREATE (FILE) SQRT.ALG<RET>
Input: SQRT.ALG.1
00100
<ESC>
|
@CREATE (FILE) SQRT.ALG<RET>
Input: SQRT.ALG.1
00100 BEGIN<RET>
00200 REAL X,Y;<RET>
00300 WRITE ("[2C] TYPE THE VALUE OF X: [B]");<RET>
00400 <TAB> READ (X);<RET>
00500 <TAB> Y :=SQRT(X);<RET>
00600 WRITE ("[C] THE SQUAREROOT OF ");<RET>
00700 <TAB> PRINT (X,3,3);<RET>
00800 <TAB> WRITE (" IS ");<RET>
00900 <TAB> PRINT (Y,3,3);<RET>
01000 END<ESC>$
*E<RET>
[SQRT.ALG.1]
@
5.1.2 TV
5.1.3 EDT-20
5.2 Defining the logical name EDITOR
@INFORMATION (ABOUT) LOGICAL-NAMES (OF) EDITOR:
System-wide:
EDITOR: => SYS:EDIT.EXE
@DEFINE (LOGICAL NAME) EDITOR: (AS) SYS:EDT.EXE
5.3 Correcting typing errors
00400 REEE\AD (X)
00600 WRITE ("[C] THE OFF\O\ T\O\OEROOT OF ")