|
|
Task Reference: HP 3000 Series 9X8LX Computer Systems > Chapter 1 Learning to Use MPE/iX CommandsCreating and Editing Files |
|
The text editor EDIT/3000 is a Hewlett-Packard subsystem that comes with your HP 3000 system. The editor has its own special set of commands and subcommands that give you flexibility in creating, modifying, and deleting files. With EDIT/3000 you can create text files, command files, and job files. The command EDITOR starts the subsystem EDIT/3000. Just type the command name, and press Return:
When the editor starts, your screen should look similar to this:
Notice that the system prompt has disappeared and has been replaced by the editor prompt, the slash (/). The editor prompt (/) allows you to issue EDIT/3000 commands. When the editor prompt (/) and the cursor are alone on a blank line, the editor is in command mode. In command mode, you can issue EDIT/3000 commands, but you cannot create lines of text. To leave the editor program, use the END (or E) command. Try this now:
Your screen should look like this:
The computer once again displays the system prompt. Start the editor again using the EDITOR command, enter:
Does the editor slash prompt (/) appear on your screen? If it does, you are in command mode. You can enter commands in all uppercase letters, all lowercase letters, or a combination of uppercase and lowercase letters. The command to start entering lines of text in the editor is ADD or A. Try typing the ADD command now:
It should look like this on your screen:
The ADD command puts the editor in edit mode. Now you can enter your text. The editor provides the number of the next line where you will be typing. Since you have started a new file, the first line number is 1. You are now ready to begin typing text. Try typing this now:
Does your screen look like this?
Notice that the editor labeled the first line 1. Each time you press Return, the editor gives you a new line, with the next number in sequence. As you continue, keep in mind these guidelines:
Type the rest of these lines, and notice where to press the Return key:
Your file should look like this:
Notice that the cursor is on an empty line. You are now ready to change back to command mode. To do this, enter two slashes on line 6. Your screen should look like this:
To stop adding text, enter two slashes on the empty line:
The editor is now in command mode. You can execute EDIT/3000 commands again. Remember that any line that ends in //Return is discarded. EDIT/3000 discards that line and waits for your next command. At this point, you may wish to see all of the file that you have just written. To see all of your file on the screen, use the LIST ALL command. Try this now:
You should see all of the file scroll upward on your screen. If it were a long file, you might need to use the Ctrl S keys to stop the scrolling and then the Ctrl Q to continue the scrolling. You can display a single line of text. Try this now:
You should see line 4 on your screen. You can also display a portion of a file. Enter:
This tells the computer to show you lines 2 through 4. You should see lines 2, 3, and 4 scroll into view. In order to keep your text permanently, you must save the file to disk. The command to save or keep a file permanently is KEEP or K. This saves the file on a computer disk. The editor requires that you give the file a name when you keep it on the disk. This time call it FILE1. Enter:
You will know that your file has been kept when the slash prompt (/) reappears. Now that you have created and kept a file, how can you keep track of any or all of the files that you save? The LISTFILE command alphabetically displays file names to your terminal screen. But the LISTFILE command is a system command, not an editor command. Most subsystems allow you to enter system commands from within the subsystem. In order to do so, you must precede the command with the system prompt. To list the files now, enter LISTFILE with a colon (:) preceding it.
Your screen should look something like this:
FILE1 is the file that you just created. To exit, enter:
Using the editor, you have learned to create and save files. Now you will learn how to edit your files. From within the editor and at the slash prompt (/), enter:
The TEXT command instructs the computer to find the specified file (FILE1), and, if it exists, to put it into the editor's workspace for viewing, for printing, or for editing. To display the entire FILE1 file to your screen, enter:
This file should look familiar to you by now. The ADD command automatically begins adding lines at the end of the existing file, no matter where the end of the file is found. At the slash prompt (/), enter:
This adds a new blank line labeled 6 onto the screen. You are now ready for typing. Add the following lines 6 through 9 to your file.
Look at the new text. Enter:
Your screen should look like this:
Now try adding text in the middle of your file. To do this, use the ADD command with a line number. This starts a new line immediately after the number that you have specified. Try this:
and at line number 5.1 type the following:
Once again you needed to use two slashes to indicate the end of your text. At the slash prompt, enter:
Your screen should look like this:
Notice that to insert new lines between 5 and 6, the editor adds the new lines with increments of 0.1. It can also add lines in increments of 0.01 or 0.001. The DELETE or D command erases a line or a range of lines. Try now to erase the last line. Enter:
Your screen should look like this:
The DELETE command displays the line that you erased. See for yourself. Use the LIST ALL command to verify that line 9 has been deleted. Enter:
Your screen should look like this:
You can delete consecutive lines by specifying the line range that you wish to erase. Try now to erase lines 6 through 8 of your document. Enter:
Use the LIST ALL command to make sure the lines that were deleted. Enter:
Your screen should look like this:
Your file should end with line 5.2. To reorder the numbering, use the GATHER command. Try this with your file now:
To see your screen, enter:
Your screen should now show lines 1 through 7. To ensure that all of your changes are kept on the system, try saving your file now. Enter the KEEP command now:
Your screen should look like this:
The MODIFY command tells the computer to let you edit specific text lines. For example, MODIFY 2 allows you to edit line 2 in your text file. The MODIFY command in the editor uses three commands: D, I, and R.
Try each of these commands on your file now.
Notice that the editor prompts you for the changes that you want to make. When the line is correct, press Return again to tell the editor to accept the line the way it is. |
|