• Aucun résultat trouvé

Inserting Text from the File

Dans le document PDP–11 Keypad Editor User’s Guide (Page 87-91)

Inserting Text from Auxiliary Input Files

8.3 Inserting Text from the File

The text you insert from an open auxiliary input file remains unchanged in that file.

To insert text from an auxiliary input file:

1. If necessary, enter a SKIP command as described in Section 8.2, to specify the point in the input file where you want to begin selecting text.

2. As shown below, enter an INCLUDE REST, INCLUDE number LINES, or INCLUDE number PAGES command to specify the number of lines or pages of text in the input file that you want to insert.

8.3.1 INCLUDE REST Command

To insert all the text in the input file, starting at the point where the cursor is located:

1. Press GOLD and COMMAND. 2. Type:

INCLUDE REST 3. Press ENTER.

KED inserts all the text at the point where the cursor is located, moves the cursor to the end of the insertion, and closes the input file.

In other words:

GOLD COMMAND INCLUDE REST ENTER

8.3.2 INCLUDE number LINES Command

To insert one or more lines of text from the input file, starting at the point where KED is located:

1. Press GOLD and COMMAND. 2. Type:

INCLUDE number [LINES]

numbercan be from 1 to 32767. You do not have to typeLINES. If you type it, do not type the square brackets.

3. Press ENTER.

KED inserts the selected text at the point where the cursor is located.

In other words:

8.3.3 INCLUDE number PAGES Command

To insert one or more pages of text from the input file, starting at the point where KED is located:

1. Press GOLD and COMMAND. 2. Type:

INCLUDE number PAGES

numbercan be from 1 to 32767. You must typePAGES. 3. Press ENTER.

KED inserts the selected text at the point where the cursor is located.

In other words:

GOLD COMMAND INCLUDE number PAGES ENTER

In selecting pages, KED uses its default definition of a page (all the text between form-feed characters) or the definition you created with the SET ENTITY PAGE command. Be sure that the current page definition matches the way pages are marked in the input file.

8.4 Closing the File

KED closes the auxiliary input file when you end your work session. If you open a second input file while one is open, KED closes the first and opens the second input file.

In some situations you may want to close the input file. For example, if you skip beyond the point where you want to begin selecting text:

1. Press GOLD and COMMAND. 2. Type:

SKIP REST 3. Press ENTER.

KED moves from its current location to the end of your input file and then closes it.

In other words:

GOLD COMMAND SKIP REST ENTER

8.5 Examples

This section summarizes most of the information in this chapter by providing examples of the steps necessary for copying text from an auxiliary input file to a file you are creating or editing.

Each step has two parts.

1. An instruction to complete

2. The keys you must type to complete the instruction

The keys you must type are presented in a horizontal line, and the strings of letters and numbers you must type are not enclosed by boxes.

This section provides examples of:

Inserting text from an auxiliary input file

Using auxiliary output and input files to move a large section of text

8.5.1 Inserting Text from an Auxiliary Input File

In the example at the end of Chapter 7, you created auxiliary output file AUXOUT.TXT. In the following procedure, you will use that file as an auxiliary input file and insert its contents in file WEEK2.TXT.

1. Begin your work session to create or edit WEEK2.TXT.

EDIT WEEK2.TXT/CREATE RET or

EDIT WEEK2.TXT RET

2. Use the OPEN INPUT filespec command to open AUXOUT.TXT as an input file.

GOLD COMMAND OPEN INPUT AUXOUT.TXT RET

3. Use the INCLUDE REST command to copy the contents of AUXOUT.TXT to the top of WEEK2.TXT and to close AUXOUT.TXT.

INCLUDE REST RET

4. End your work session with the EXIT command.

EXIT ENTER

8.5.2 Using Auxiliary Output and Input Files to Move a Large Section of Text

The KED paste buffer is usually large enough to let you move text around within your files. You may, however, want to move larger amounts of text than the paste buffer can hold. In that case, the general procedure for using auxiliary output and input files to move a large section of text is as follows.

1. Open an auxiliary (output) file.

2. Copy the section of text from your file to the auxiliary file, and close the auxiliary file.

3. Delete the section of text from your file.

4. Move the cursor to where you want the section of text to reappear in your file.

5. Open the auxiliary (input) file and copy the section of text from the auxiliary file to your file.

The following specific procedure for a particular file describes one method you can use. This example assumes that:

• Page numbers in your file appear at the bottom of each page and are enclosed by hyphens (for example, -7-).

• The pages are separated by the marker NEXTPAGE.

• The section you want to move includes all of pages 8, 9, and 10.

• You want to move those pages 150 lines backward in your file.

1. Open auxiliary output file AUX.TXT.

GOLD COMMAND OPEN OUTPUT AUX.TXT RET

2. Define a page in terms of the marker that separates your pages.

SET PAGE "NEXTPAGE" ENTER

3. Move the cursor to the beginning of the section of text you want to move.

a. Search forward for the string -7-.

GOLD FIND -7- ADVANCE

b. Move to the beginning of page 8.

PAGE

4. Copy pages 8, 9, and 10 to the auxiliary output file.

GOLD COMMAND WRITE 3 PAGES RET 5. Close the auxiliary output file.

CLOSE RET

6. Delete the section of text you copied to the auxiliary output file.

a. Clear the paste buffer.

CLEAR PASTE ENTER

b. Select the 3-page section of text to be deleted.

SELECT BACKUP PAGE PAGE PAGE

c. Delete that section of text.

GOLD REPLACE

7. Move the cursor to where you want the section of text to reappear.

BACKUP GOLD 150 BLINE

8. Open the auxiliary output file as an input file.

GOLD COMMAND OPEN INPUT AUX.TXT RET

9. Copy the contents of the auxiliary file to your file.

INCLUDE REST ENTER

Chapter 9

Dans le document PDP–11 Keypad Editor User’s Guide (Page 87-91)