• Aucun résultat trouvé

the current line marker is set to the first line in the output ^^

Dans le document Lt QU (Page 108-112)

buffer.

Remember, the default capacity of EDIT's output buffer is

only 40 lines. For example, if you EDIT an 80-line file and the ^^

current line marker is pointing to line 60, EDIT's output buffer

contains only lines 20 through 59 of the From file. Attempting I I to back up 40 or more lines results in the current line marker ^^

pointing to line 20.

P

moves the current line marker back one line. If verification is on, the line number and text of the new current line is dis played. The current line marker may be moved back multiple lines by stringing multiple P commands on a single line or by preceding the command with a number.

p.p.p.p.p-P

is the same as 6P

Both move the current line marker back six lines.

Ma (Move to line a). The current line marker may be moved backward or forward to a specific line number by using the M command. Using a period (.) in the a location, the cur rent line marker is moved to the end-of-file flag of the From file.

If you attempt to move the current line marker back to a line number not in EDIT's output buffer, the message Line number a too small displays. If the line number specified is greater than the highest line number of the From file, the mes sage Input exhausted displays, and the current line marker is set to the end-of-file flag.

M17

moves the current line marker to line number 17 (not the seventeenth line). If verification is on, the line number and text of the new current line is displayed.

M.

moves the current line marker to the end-of-file flag of the From file.

n

EDIT, the Line Editor

Displaying Your Text

It's often handy to examine the contents of more than one line at a time. EDIT has four commands which allow you to dis play multiple lines of the file being edited.

T« (Type n lines). The T command displays n lines on the screen (or verification device, if one other than the screen has been selected), beginning with the current line. The current line marker is set to the line following the last one typed by the T command. If n is not specified, all lines following the current line are displayed, and the current line marker is set to the end-of-file flag.

Assume that the sixth line of a file being edited is the cur rent line. The command

T5

displays the sixth through tenth lines of the file, and the cur rent line marker is changed to point to the eleventh line. The line number and text of the new current line are displayed.

If the current line marker of a 100-line file is pointing to the thirty-eighth line, and the current line marker is set to the end-of-file flag,

T

displays lines 39 through 100, and the current line marker is set to the end-of-file flag.

TP (Type Previous). The TP command displays the cur rent contents of EDIT's output buffer. If the buffer is full, the current line marker remains unchanged. If the output buffer is not full, the TP command advances the current line marker to the point which fills the buffer and then displays the contents of the buffer, followed by verification of the new current line.

For example, assume that EDIT has been invoked with the default buffer length of 40 lines and that you're editing a 70-line file. If the current 70-line is the tenth 70-line of the file (which means there are only nine lines currently in the output buffer) and you issue

TP

EDIT changes the current line marker to point to the forty-first line, moving lines 10 through 40 into the input buffer (along with the file's first 9 lines). All 40 lines now residing in the output buffer are displayed, followed by a verification display of the file's forty-first line. Any TP commands issued

immedi-EDIT, the Line Editor

ately thereafter will have no effect on the current line marker since the output buffer has been filled.

TN (Type Next). The TN command acts exactly like a Ta command in which the value of a is determined by the num ber of lines that the output buffer has been set to hold (OPT Pn). The default value for a is 40 if no Pn is specified in the EDIT command which started the current session.

TLtt (Type with Line numbers). The TL command dis plays n lines preceded by their line numbers, beginning with the current line. Lines that have been inserted or that are cre ated by splitting a numbered line in two may have no num bers. If a line has no number, EDIT displays three asterisks (*•*) in its place. The current line marker is set to the line following the last one typed by the T command. If n is not specified, all the lines following the current line are displayed, and the current line marker is set to the end-of-file flag.

Inserting New Text

EDIT allows text to be inserted before the current line or any line that may be referenced by a line number. The text to be inserted may be typed in via the keyboard or may be read di rectly from another AmigaDOS file.

The I command, when used in conjunction with a specific or relative line number, allows text to be inserted in EDIT's output stream.

• I or I. is used to insert text before the current line.

• I* inserts text after the last line of text in the From file.

• la, where a is the line number that EDIT associates with a given line of the file being edited. An la command may search backward into EDIT's output buffer or forward, past the current line, in search of the specified line number. Once the line number is found, the line associated with it is made the current line.

Insert commands all throw EDIT into insert mode. Any text typed at the keyboard will be inserted before the current line (into EDIT's output buffer). Insert mode is terminated by typing a line containing only the letter z (lowercase or upper case) in the first column and hitting the RETURN key. The in serted text will have no line number. Upon exiting insert mode, the current line will be displayed—it will be the same line as when the I command was invoked.

u

u

EDIT, the Line Editor

Let's try it out. Insert several lines before the current line:

I

Well this is a silly little example of how to insert a couple of lines

and then get out of Input's insert mode.

z

Insert several lines before line number 17:

117

Had enough folks?

EDIT can be a barrel of laughs.

z

Note: You may change the input mode terminator to any string of up to 16 characters by using the Z command. For example,

Z/fin/

changes the input mode terminator from z to fin; fin will re main the input terminator through the end of the current EDIT session or until another Z command is issued.

• \/filename/ (Insert before current line from a file)

or

• \a/filename/ (Insert before line a from a file)

Insert also lets you specify an AmigaDOS file as the source for lines to be inserted. Filenames used in conjunction with insert and replace commands are normally delimited by slashes (/), although the colon (:), period (.), comma (,) and asterisk (*) may also be used. Lines inserted from an

AmigaDOS file into EDIT will have no line numbers asso ciated with them. Here are some examples.

Insert the contents of the file mytext before the current line:

I /mytext/

Insert the contents of the file Wow/What a Party on the ex ternal disk drive before line 66:

166 /"DPI:Wow/What a Party"/

EDIT, the Line Editor

U

Replacing Lines with Inserted Text \" j

Dans le document Lt QU (Page 108-112)