Add (Adding New Lines)

Add some new lines from the terminal keyboard. Insert them at a given line number or after it.

ADD [ linenum ]

(Q=no linenums, J=justified, T=template)

(Default: linenum = *)

The linenum parameter specifies where to add new lines and also determines the increment between new lines. If linenum is 9.1, lines will be incremented by 0.1; if 9.01, then 0.01. If linenum already exists, Qedit increments it and begins adding after the existing line. If linenum is 0, Qedit adds new lines before the first existing line in the file. If you don’t say which linenum, Add inserts the lines after the current position (*). (See Miscellaneous Points below.)

Examples

  /add 5             {add new lines after line 5}      5.1   line a   {Qedit prompts with line number}      5.2   line b   {you enter line of text and Return}      5.3   //       {you enter // or Control-Y to stop}  /aq                {add after * line; no prompt}  This is new text  //                 {end the Add command}  

Temporary Workfile: Qeditscr

If you do not have a named workfile Open when you Add, Qedit automatically builds a temporary workfile for you. This file is named Qeditscr (or Qednnnnn if you have Set Work Random On), and it is job temporary, meaning it goes away when you log off the computer. Therefore, you should convert it into a permanent Qedit workfile by doing Shut filename or into a permanent Editor-style file by doing Keep filename.

Making Qeditscr Permanent

Do you access Qedit over a telephone line? Have you ever been disconnected by noise on the line? If so, you probably know that Qeditscr is a job temporary file. When your session is lost, so is your editing work. Of course, if you were editing a named Qedit file that you Opened, you would not lose anything.

Qeditscr can easily be converted into a permanent file so that it will not be lost on :BYE. However, if two people share the same logon group, the Qeditscr file cannot be permanent for both of them! Here are the commands to create a permanent scratch file for yourself:

  /:purge qeditscr,temp  {purge existing file}  /set work size 3200    {ensure file is big enough}  /open                  {creates new Qeditscr}  /shut  /:save qeditscr        {make permanent}  

Another way of using permanent scratch files is to pass a file name for Qedit to edit, or to use Set Work Random On. See the “Running Qedit Under MPE” chapter for more information.

Using the Tab Key

By default, Qedit defines tabs every 10 columns across the line (every 8 for Qedit/UX). You can override these default tab stops using Set Tabs Stop n (every 2 to 15 characters) or Set Tabs 5 10 22 28 … for completely custom tab stops. When you press the tab key as you Add lines, Qedit correctly inserts spaces in your lines and skip to the correct column on your screen (assuming you are using an HP terminal).

Overflowing Lines or Line Numbers

The Add command continues prompting until you press Control-Y, or you type “//” at the end of a line, or you run out of line numbers. When you exhaust the line numbers possible between two lines, Qedit prints “Error: Already”. You can continue by doing a range Renumber on the area where you wish to add more lines. Thus, if your last line added was 4.999, use Renum 4/5 to spread out the lines between 4 and 5.

You can configure Qedit to automatically renumber part of the file so that you do not have to renumber it manually. See the Set Visual Renum option.

Line Wraparound

If you enter a line that is too long, Qedit divides it into several lines. Set Wraparound ON divides lines on “word” boundaries only. Any words that will not fit on the current line are moved to the next line. If only a small number of words are moved to the next line, Qedit prompts you to complete the line. To end the Add when this happens, press Return before typing “//”. If you are editing FORTRAN source code, Qedit generates a valid continuation line for you.

Automatically Indenting Lines

AJ for justified is a special option to indent new lines. The linenum you specify must be an existing line. You enter new lines beneath it. Qedit will then indent the new lines by exactly the same number of spaces as the existing line. You can shift the indentation left by typing {‘s at the start of a line, or shift it right with }’s. To redefine the { and } characters, use Set Zip.

Modifying a Line During Add

When you know you made a typo, and prefer to fix it now instead of going on, the auto-modify character will help you. Enter the command Set Zip []@{}#, or better yet, put it in your Qeditmgr configuration file. The # character (or other special character of your choice) is called the auto-modify character. It allows you to modify the line you are currently entering. Type “#” at the end of the line, and Qedit redisplays the line for you to modify. When you are done with the Modify, you press Return to continue adding new lines.

Miscellaneous Points to Note

If you have Set Left/Right margins, the new lines added will have spaces to the left and right of the margins. That is, the line you enter will be left-justified within the current margins of the workfile.

The maximum default increment between new lines is 1.0 (or 0.1 for standard COBOL files). You can change this default with Set Increment.

You can ask Qedit to remove nonprinting characters from your input lines using Set Editinput Data ON. If you do not wish to allow the extended Roman-8 characters, use Set Editinput Data ON Extend OFF.

Add (Adding New Lines)