Qedit 6.6 for Linux

User Manual

Doc-To-Help Standard Manual

by Robelle Solutions Technology Inc.

qed-ybo


 

Program and manual copyright © 1977-2024 Robelle Solutions Technology Inc.

Permission is granted to reprint this document (but not for profit), provided that copyright notice is given.

 

 

Qedit and Suprtool are trademarks of Robelle Solutions Technology Inc. Windows is a trademark of Microsoft Corporation. Other product and company names mentioned herein may be the trademarks of their respective owners.

robelle

Robelle Solutions Technology Inc.

7360 – 137 Street, Suite 372

Surrey, B.C. Canada V3W 1A3

Phone:  604.501.2001

Fax:      604.501.2003

E-mail: sales@robelle.com

E-mail: support@robelle.com

Web:    www.robelle.com


 

 

Contents

Qedit 6.5 for Linux. i

User Manual. i

Welcome to Qedit. 7

Introduction. 7

Documentation. 8

User Manual 8

Notation. 8

Highlights In Version 6.5. 10

Highlights In Version 6.4. 10

Getting a Quick Start with Line Mode Editing. 11

Introduction. 11

Adding Lines to a File. 11

Looking at the File. 12

Browsing the File. 13

Searching the File. 13

Editing Lines. 14

Global Changes. 15

Copying Lines. 16

Moving Lines. 17

Deleting Lines. 18

Saving the File. 18

Open and Shut for Instant Access. 19

Running Qedit under Linux. 21

Running Qedit. 21

Edit Several Files at Once. 21

How to Edit Several Files?. 22

Starting a New Scratch File. 22

Configuring Different Shells. 22

Bash Shell 22

Setting Up a PATH for Qedit. 23

Bash Shell 23

Qeditmgr Configuration Files. 23

Default Set Commands. 23

On-Line vs. Batch Access. 24

Command Line Options. 24

Initial Command Line:  -ccmdstring. 24

Editing a Single File:  -s. 25

Exit with Verify:  -v. 25

"Discard Changes?" on Exit 25

Linux Notes. 25

EDITOR Variable. 25

Scratch File. 26

Hold Files. 26

Shell Commands. 27

Tab Stops. 27

Control Characters and stty. 27

Hardcoded File Names. 28

/opt/robelle/qeditmgr 28

$HOME/.qeditmgr 28

Variables that Drive Qedit. 28

ROBELLE Environment Variable. 28

QEDCURWFILE Variable. 29

Converting Qedit Files with qcat. 29

Differences Between MPE and Linux. 29

Open/Shut 29

Current "*" File Name. 30

Missing Features. 30

Qedit Issues and Solutions. 33

Files without NewLine Characters. 33

Lines, Strings and Ranges. 34

Qedit Commands. 37

Introduction. 37

General Notes. 37

Abbreviations. 37

Uppercase or Lowercase. 38

Multiple Commands per Line. 38

Comments on Command Lines. 38

Stopping Commands with Control-Y. 39

Implicit Commands. 39

Shell Commands. 39

Calculator Commands. 39

Add Command [A] 41

Add (Adding New Lines) 41

Add (Adding a String as a Line) 43

Add (Copying Lines within a File) 43

Add (Moving Lines within a File) 44

Add (Copying Lines Between Files) 45

Append Command [AP] 47

Backward Command [BA/F5] 48

Before Command [B] 49

CD Command [CD] 51

Change Command [C] 52

Change (Changing Strings) 52

Change (Changing Columns) 55

Close Command [CL] 57

Colcopy Command  [COL] 58

Colmove Command  [COLM] 61

Delete Command [D] 64

Destroy Command [DES] 66

Divide Command [DI] 67

:Do Command [DO] 68

Exit Command [E/F8] 69

Find Command [F/F4] 70

Findup Command [FINDU/F3] 72

Form Command  [FORM] 73

Forward Command [FO/F6] 74

Garbage Command [GAR] 75

Glue Command [G] 76

Help Command [H/?] 77

Hold Command [HO] 78

Justify Command [J] 80

Keep Command [K] 87

List Command [L] 91

:Listredo Command [LISTREDO/F7] 104

:Listundo Command [LISTU] 105

LS Command [LS] 106

Lsort Command [LSO] 107

Merge Command [ME] 108

Modify Command [M] 110

New Command [N] 117

Open Command [O] 118

Proc Command [P] 122

Q Command [Q] 123

:Redo Command [REDO] 124

:Reflect Command [REFLECT] 126

Renumber Command [REN] 128

Replace Command [R] 129

Set Command [S] 130

Account 132

Alias. 132

Autocont 134

Check. 135

Decimal 135

DL size. 136

Editinput 136

Expandtabs. 137

Extentsize. 137

Extprog. 137

Filename. 138

FORTRAN.. 138

Halfbright 138

Hints. 139

Hppath. 139

Increment 139

Interactive. 139

Justify. 140

Keep. 140

Language. 143

Left 146

Length. 147

Lib. 147

Limits. 147

List 148

Maxdata. 148

Modify. 148

Open. 150

Pattern. 151

Priority. 151

Prompt 151

Redo. 151

Right 153

RL file name. 153

Shift 153

Spell 154

Statistics. 154

Stringdelimiters. 154

Tabs. 155

Term.. 156

Text 157

Totals. 159

UDC. 159

Undo. 159

Varsub. 160

Visual 161

Warnings. 174

Whichcomp. 175

Window.. 175

Work. 176

Wraparound. 177

X. 178

Zip. 182

Shut Command [SH] 184

Spell Command [SP] 185

Text Command [T] 186

Undo Command [UN] 192

Up Command [UP/F2] 194

Use Command [U] 195

Verify Command [V] 196

Visual Command [VI/F1] 197

Words Command [W] 200

Zave Command [Z] 201

ZZ Command. 202

Calculator Command [=] 203

Troubleshooting and Error Messages. 207

Introduction. 207

Messages. 207

Quit Errors. 210

File Formats. 210

Introduction. 210

Qedit Workfiles. 210

Original Format Workfiles. 211

Jumbo Workfiles. 211

External Files. 212

Regular Expressions. 217

Introduction. 217

Metacharacters. 217

Character Class. 219

Escape Character. 221

Escaped Sequences in Regular Expressions. 222

Backreferences in Regular Expressions. 223

Escaped Characters in Replacement String. 224

Qedit Glossary. 225

Introduction. 225

Terms. 225

Abbreviating. 225

Batch. 225

Calculator 226

Column. 226

Command. 227

Control Character 227

CRT. 228

Current Line. 228

Defaults. 228

External File. 228

File Names. 229

Full-Screen Editing. 229

Hold File. 229

J Option. 230

Jumbo Files. 230

Keep File. 230

Language. 230

Left 231

Length. 231

Line. 231

Linenum.. 231

Margins. 232

Memory Lock. 232

Patterns. 233

Quiet-Q Option. 234

Range. 234

Rangelist 234

Relative Line Numbers. 236

Right 236

Shifting. 237

String. 237

Tab. 237

Template-T Option. 238

Window.. 238

Workfile. 239

Special Characters. 239

? Means Help, Nonprinting Characters, Alphanumeric (in Patterns) or Optional (in Regexp) 240

$ Means Hex, Memory Lock, List Option, Previous File or End-Of-Line (in Regexp) 240

^ Means Findup, Control-Char, Start-of-line (in Regexp) or Negate (in Regexp) 241

. Means Nonprinting, Reset, Decimal Point or Any Character (in Regexp) 241

! Means Shell Script or Too Long. 242

% Means Octal or String. 242

* Means Current, Refresh, Multiply or Quantifier (in Regexp) 242

\ Means Previous, String, Literal Match (in Regexp) or Special Characters (in Regexp) 243

/ Means Prompt, Range Delimiter, Stop, Exit, or Divide. 244

[ Means FIRST, [default] or Start Class (in Regexp) 244

] Means LAST or End Class (in Regexp) 244

{ } Are for Comments or Indentation. 245

@ Means ALL. 245

& Means Literal Match. 245

: Means Shell Commands or String. 245

; Means Multiple Commands. 246

, Means a List 246

= Means Copy or Calculate. 246

< Means Move, I/O Redirection or Backward Page. 247

> Means Forward Page, I/O Redirection, Modify or Qhelp. 247

" Means String. 247

( Means Start Parameter, Command or Subpattern (in Regexp) 248

) Means End Parameter, Command or Subpattern (in Regexp) 248

+ Means Ahead Some Lines, Add or Quantifier (in Regexp) 248

- Means Back Some Lines, Minus or Range (in Regexp) 249

# Means Numeric Pattern. 249

~ Means Spaces (Pattern) 249

How to Contact Robelle. 251

Support. 251

Index. 251

 


Welcome to Qedit

Introduction

Welcome to Qedit, the fast, full-screen text editor for MPE, HP-UX and Linux. To get into Qedit/Open, enter this command:

/opt/robelle/bin/qedit

 

Commands:

Add

FINDUp

Open

ZZ

Add(=copy)

FORM

Proc

%ext

Add(<move)

FORward

Q

shell

Add(=file)

GARbage

REDO

 

Append

Glue

RENum

 

Backward

Help

Replace

 

Before

HOld

Set

 

Change

Justify

SHut

 

COLcopy

Keep

SPell

 

COLMove

List

Text

 

Delete

LISTREDO

UNDo

COmp

DEStroy

LISTUndo

Use

RUN

Divide

LSort

Verify

mpe

DO

MErge

Visual

Udc

Exit

Modify

Words

Cmdfile

Find

New

Zave

=calc

 

Documentation

Qedit comes with a User Manual and a Change Notice. You may have received printed copies of these. If you wish to have printed copies, you can order them by filling out the form on our web site.

They are also available as PDF or HTML files. You can download the files from the Robelle web site at: http://www.robelle.com/library/manuals/.

User Manual

The user manual contains the full description of all the Qedit commands, as well as usage tips. The manual is up-to-date with all the latest changes incorporated in Qedit.

Notation

This manual uses a standard notation to describe commands. Here is a sample definition:

VERIFY         [ @ | ALL ]

[ keyword ...]

1.      UPPERCASE - If the commands and keywords are shown in uppercase characters in a syntax statement, they must be entered in the order shown (example: ALL). However, you can enter the characters in either uppercase or lowercase.

2.      Lowercase, highlighted - These are "variables" to be filled in by the user (example: keyword). The variables may be highlighted by underlining or italics. Each such "variable" is defined elsewhere (see the "Qedit Glossary" on page 225 when you have trouble). In the Help command, highlighting is not available, so these variables appear simply in lowercase.

3.      Brackets - enclose optional fields (example: [ALL]).

4.      Braces - enclose comments which are not part of the command. However, braces and comments are accepted in actual Qedit commands.
/listq filename {Q means without line numbers}

5.      Up lines - separate alternatives from which you select (example: SET CHECK [ON|OFF]). The choices are sometimes listed on several lines without "up lines".

6.      Dot-dot-dot (...) - indicates that the variable may be repeated many times in the command.

7.      Other special characters - literal symbols that must appear in the command as they appear in the manual (for example, "=" in Add linenum = rangelist).

In examples, there is an implied Return key at the end of each line.

In examples in our documentation, we generally show Qedit commands preceded by the Qedit "/" prompt. However, in Qedit/Open the default prompt is actually "qux/". Note that you can change the prompt string with Set Prompt.

Control characters, generated by holding down Control while striking another key, are either spelled out (e.g., Control-H) or abbreviated with a circumflex prefix (e.g., ^H).

When Qedit asks you a question, the default answer is shown in [brackets]. The default is the answer that Qedit will assume if you press only the Return key.


 

  Highlights In Version 6.5

This is an overview of all the changes implemented in this version.

·      Visual Mode for HP terminals has been added to Qedit/Open

·      Qedit visual mode has been ported and added to the Linux version. (Linux only)

·      The behaviour of regexp window has been fixed in one corner case. (All platforms)

·      Help files are now working in Qedit/Open. (Linux Only)

·      Hold files are now working in visual and in other areas of Qedit/Open.

·      An issue was fixed when Qedit repainted the updated screen incorrectly after a block copy or move is now fixed.

·      Set vis above can only be 0. This is a temporary. (Linux Only)

·      Set Vis BlockEmulation has been turned on by default. (Linux Only)

Highlights In Version 6.4

·           Add with move syntax would abort, this is now fixed. A typical syntax is add last < 1/3.

·            Adding a block of text would incorrectly print out line numbers at the end of the block of text. For the time being ADD will revert to ADDQ while we investigate this issue.

·           The Modify command will default to Modifyq for the time being as to when we resolve some terminal issues.

·           Qedit has been ported to Linux, specifically Small Endian Linux Machines.

 

 


 


Getting a Quick Start with Line Mode Editing

Introduction

You don't have to learn every command in order to use Qedit. With just a few of the basic functions, you can take care of editing job streams, programs, memos, or big text files. First, find out how to run Qedit on your system. Your system manager may have set up an easy way to access Qedit (try typing qedit). Look for a slash prompt (/ on MPE or qux/ on Linux), which tells you Qedit is ready to go.

This introduction will make the following activities familiar to you: adding lines to a file, looking at the contents of files, searching files for specific characters, changing one line or many lines, deleting, moving, and copying lines, and saving files. In the examples to follow, watch for comments on the right-hand side, enclosed in curly braces. Whatever you see in { } is an explanation, not part of the command, although Qedit will accept it. Press Return after each command line. When you finish your session, getting back out of Qedit is easy. Type Exit, and press the Return key:

/exit

Adding Lines to a File

You add text with the Add command. Qedit numbers each line you add. Pressing Return at any spot in the line moves you to a new line. This means that you can put a blank line into your text if you press Return twice in a row. Qedit continues to add your lines of text until you type // (two slashes) at the beginning of a new line and press Return. Try typing Add right now, and Qedit moves the cursor and prints some identifying information:

/add                          {remember to press Return}

 QEDITSCR                     {Qedit displays this line}

 Temporary File List * = 1    {and this line too}

  1  _                        {go on, Qedit is waiting for you}

Continue to "add" by typing in this example:

  1    MEMO TO: Drama Staff, News Simulation Dept.

  2

  3    FROM:    Marie Reimer, Publicity Dept.

  4

  5    Please check your in-baskets daily and

  6    respond to your fan mail within a week.

  7    //                     {stop adding for now}

/                             {Qedit is waiting again}

You can add lines anywhere in the file by typing Add followed by the line number where you want to start your insertion. For example, if you decide to date this memo, type at the slash prompt:

/add 2

  2.1  DATE:  November 18, 2000

  2.2

  2.3  //

/

You have added line 2.1 for the date, and line 2.2, which is blank. Line 2.3 is not put into your file, since typing the double slash stopped the adding. Notice that Qedit used line numbers that would fit between line 2 and line 3. Now, if you want to see what the whole thing looks like, type List ALL at the slash prompt.

/list all

  1    MEMO TO: Drama Staff, News Simulation Dept.

  2

  2.1  DATE:  November 18, 2000

  2.2

  3    FROM:    Marie Reimer, Publicity Dept.

  4

  5    Please check your in-baskets daily and

  6    respond to your fan mail within a week.

/

Looking at the File

The command for looking at the file is List. But you can do much more than List ALL. For example, you can list a file you're not even working on. Our sample memo is a temporary file, in your group, named Qeditscr, but you could look at a file in another group now without harming the memo by typing, for example:

/list /etc/profile

The file /etc/profile may be scrolling by on your screen, but don't panic.

Browsing the File

If you want to browse through the file, the command you need is LJ. LJ stands for List-Jump. Qedit shows you a screen of text, prints

More?[yes]

at the bottom of the screen, and waits for you. If you press Return, Qedit displays the next screen. You can stop browsing by pressing Control-Y, typing NO or just N, or by typing //. Also, you can type any command, and Qedit stops browsing to execute it. To request a List-Jump:

/lj 6                     {begin browsing at line 6}

/lj /etc/profile          {browse configuration file}

Searching the File

So far, you typed line numbers to specify which lines you wanted to see. There is another way to list lines, and that is to specify an identifying string. Put anything in quotes and it's a string. Qedit lists all the lines that contain that exact same "anything".

/list "your"

  5    Please check your in-baskets daily and

  6    respond to your fan mail within a week.

2 lines found

There are two occurrences of "your" in the file, one on line 5 and one on line 6.

Strings can help you find a particular place in the file quickly.

With the commands Find and Findup, you can go to the next consecutive location of a string. Find searches the file from your current location to the end. Findup searches backwards from where you are to the beginning. So in order to search a file for a date scattered throughout it, type:

/find "January 18"       {search forward from current line}

 Or, search back through the file with

/findup "January 18"

Qedit displays the next line containing "January 18". To search again for the same string, just type Find (or Findup). You can abbreviate "Find" to "F" and "Findup" to "^".

/f

To search for a different string, just type F "new string".

Editing Lines

Suppose you want to change the date of your memo. You could do it the slow way, first deleting the line, then adding a replacement line with the new date. But instead of all that retyping, try the Modify command. Modify has a lot of power. Here's how to use it:

1.      Type M and the line number.

2.      Qedit displays the line, and you move along on the line below it by pressing the space bar.

3.      Stop at the point where you want to make your correction.

4.      Type in the change to be inserted and press Return.

5.      Qedit displays the entire corrected line for your approval. Make another correction if you want, and when satisfied, press Return again to accept the corrected line and get back to the slash prompt.

An example:

/m2.1

  2.1  DATE:  November 18, 2000

                        9        {move with the space bar}

                                 {press Return}

  2.1  DATE:  November 19, 2000  {press Return again}

Here is a partial list of special things you can do with Modify:

 

^B

insert text Before this column

^D

DELETE text from this column onward

^L

add text after the LAST column in the line

^O

OVERWRITE (or replace) columns

^T

TRAVEL over the line without changing it

^G

GOOFED. Put the line back the way it was, please

 

Note: The little symbol ^ is a shorthand way of saying that you hold down the Control key (on some keyboards abbreviated Ctrl) while at the same time pressing the letter. For example, ^B (or Control-B): keep the Control key down with one finger while with another, type a B. These symbols won't show up on your screen.

Linux reacts to certain control characters which might conflict with the Qzmodify codes. For example, control-D sends an end-of-file signal to Linux but is also the delete character in Qzmodify. You should use the Linux stty program to change the default end-of-file signal. Please see the section Control characters and stty for more details.

This command is easy to use but awkward to describe; you'll understand how to use it much faster if you give it a try. Let's take a typical example, and modify line 5 of our memo. Begin by typing "m5" and, of course, pressing Return. Then, to replace "daily" with "every day", our first step is to delete the word. Use the space bar to move to the column under the "d" in "daily". Press ^D (you won't see anything, remember), then space across all the columns you want to delete. Don't press Return yet.

The second step is to insert the two new words. Press ^B and type "every day". Now press Return to see the line with the revisions.

Qedit lets you see your revisions and continue modifying with as many different changes as you can fit into one pass, before you press Return. In order to make changes at different locations in a line, press ^T to space over the intervening characters without disturbing them. If you goofed, press ^G instead: you'll get your original line back.

The final step is to accept the revisions by pressing Return one last time.

If your fingers are so trained to MPE's style of Modify (e.g., D for delete) that you cannot remember to use the Control key, do not despair. As with most things in Qedit, there is a configuration option to solve this problem. The command Set Mod HP instructs Qedit to accept HP-style modifies (i.e., MPE modifies such as D and I), instead of Qedit-style. See the Modify section of the Set command.

Global Changes

There is another way to modify lines in your workfile. The Change command allows you to make changes throughout the entire file, without the bother of working on each line one by one. For example, with one Change command to your memo, you can replace all the colons with dashes.

/change ":"-" all

  1    MEMO TO- Drama Staff, News Simulation Dept.

  2.1  DATE-  November 19, 2000

  3    FROM-    Marie Reimer, Publicity Dept.

3 lines changed

Using the Change All command is a one-way street. If we now decide we don't like the dashes and want to get the colons back, observe what happens to Line 5.

/change"-":" all

  1    MEMO TO: Drama Staff, News Simulation Dept.

  2.1  DATE:  November 19, 2000

  3    FROM:    Marie Reimer, Publicity Dept.

  5    Please check your in:baskets daily and

4 lines changed

This second Change command has gotten us into hot water. Luckily, Qedit has an Undo command that takes your file step-by-step backwards to put it back to the way it was. See the Undo command in the "Qedit Commands" chapter.

CJ Command

If you're not sure what the consequences of a global change will be, use the CJ command. CJ stands for Change-Jump. Qedit shows you each line it means to change, and waits for you to approve, to change your mind, or to modify that line. Then Qedit jumps to the next occurrence of your string, and repeats its question until you have dealt with all occurrences of the string in the file. To accept the default answer of NO (i.e., don't replace the string), shown in square brackets, just press Return.

/cj":"-" all

  1    MEMO TO: Drama Staff, News Simulation Dept.

Change okay (Y,N or Modify) [No]:  {press Return}

  2.1  DATE:  November 19, 2000

Change okay (Y,N or Modify) [No]:  {press Return}

  3    FROM:    Marie Reimer, Publicity Dept.

Change okay (Y,N or Modify) [No]:  {press Return}

  5    Please check your in:baskets daily and

Change okay (Y,N or Modify) [No]:Yes

1 line changed

You can use the handy ^Y to stop in the midst of change-jumping just as you used it to stop listing.

Rangelist

You can also specify individual lines or a rangelist to Change. For example,

/change "Dept."Department" 1/3

  1    MEMO TO: Drama Staff, News Simulation Department

  3    FROM:    Marie Reimer, Publicity Department

2 lines changed

 

/change "Drama Staff, "" 1  {changes string to nothing}

                            {i.e., deletes it}

  1    MEMO TO: News Simulation Department

1 line changed

Copying Lines

Copying lines is a variation of the Add command. One reason we might want to copy lines is to make a general-purpose form out of our memo. We can keep a sample memo form at the beginning of the file, then copy it to the end of the file and fill it in whenever we need to communicate. This is how to do it:

/add last = first/4

  7    MEMO TO: News Simulation Department

  8

  9    DATE:  November 18, 2000

 10

 11    FROM:    Marie Reimer, Publicity Department

 12

6 lines COPIED

Qedit copies the rangelist (first/4 = first line to line 4) after the indicated line (here, last line in file). To accomplish our goal of placing the sample memo template at the beginning of the file, we'll have to move the first six lines so they follow our new sample. Before we try moving lines, a last tip on copying: you can copy lines from an external file by including the file name in the command, placed after the equals sign and right before the rangelist.

Moving Lines

Moving is very similar to copying; it's another form of the Add command. But, instead of using the equals sign, use the less-than sign. You can specify:

/add 12 < 1/6

 13    MEMO TO: News Simulation Department

 14

 15    DATE:  November 18, 2000

 16

 17    FROM:    Marie Reimer, Publicity Department

 18

 19    Please check your in-baskets daily and

 20    respond to your fan mail within a week.

8 lines MOVED

Qedit moves the rangelist (in this case, lines 1 to 6) after the indicated line (in this case, 12). In case you were wondering, we could have used "last" instead of the number "12". You can add, move, or copy lines to any spot. In fact, we could have copied the first six lines to the beginning of the file in the first place, but then we wouldn't have had this fascinating "move" example. The result of this particular move is

/list all

  7    MEMO TO: News Simulation Department

  8

  9    DATE:  November 18, 2000

 10

 11    FROM:    Marie Reimer, Publicity Department

 12

 13    MEMO TO: News Simulation Department

 14

 15    DATE:  November 18, 2000

 16

 17    FROM:    Marie Reimer, Publicity Department

 18

 19    Please check your in-baskets daily and

 20    respond to your fan mail within a week.

Deleting Lines

To demonstrate the Delete command, we'll get rid of our memo template. On some systems, Qedit asks for confirmation before deleting a large number of lines. If so, you can cancel the deletion just by pressing Return; to confirm the deletion, type "yes" and press Return. The abbreviation for Delete is simply D :

/d first/12

  7   _MEMO TO: News Simulation Department

  8   _

  9   _DATE:  November 18, 2000

 10   _

 11   _FROM:    Marie Reimer, Publicity Department

 12   _

DELETE 6 lines [no]? yes

If you typed "yes" without due consideration, you now have a chance to take it back. Press Control-Y, and Qedit saves your bacon with the message "Undeleted!" But you must press Control-Y immediately: if you do anything else between the deletion and the rescue, Qedit will commit to the deletion. However, in this situation the Undo command can bring your lines back, even if you have made more changes. You must undo each change to the file in reverse order. See the "Qedit Commands" chapter of the manual for details.

Saving the File

There are two commands that preserve your work: Keep and Shut. First, invent a name for your file. Naturally, two files cannot have the same name. The name must be a valid Linux file name. We've been working on a temporary file. To save it, name it:

/keep myfile1

When you want to work on Myfile1 again, type:

/text myfile1

and Qedit will copy Myfile1 for you to use. If you make changes to the file, remember to Keep it again before you leave Qedit to make the changes a permanent part of the file.

Open and Shut for Instant Access

Only Qedit files can be opened and shut. It is much faster to use the Open command than it is to use the Text command, because you make changes directly to the Open file. With a Text file, you must wait for Qedit to make a copy to which you make your changes.

Using the Shut command saves the current scratchfile as a permanent Qedit workfile. In the case of a scratchfile, the name of the new workfile must not exist. You can Shut a new file, or a file that you made a copy of (with the Text command). Name the file as described above.

If you are working on a Qedit workfile, Qedit renames it before closing.

qux/t myfile1

'Language' is now DATA                 {copy of myfile1 in scratchfile}

20 lines in file

qux/sh myfile1

Retained existing file for you.        {myfile1 already exists. No change.}

qux/sh myfile1.work                    {renamed to myfile1.work}

qux/open *

Open /home/user1/myfile1.work Current = 1 Margins = 1/80

qux/sh myfile1.newwork

File renamed.

A workfile looks like any other file from the outside. For example,

ll myfile1*

-rw-rw-rw-   1 francois   users          533 Aug 17 18:33 myfile1

-rw-rw-rw-   1 francois   users        16384 Dec  8 07:15 myfile1.work

However, you can use the Linux file command to determine the file type. In order for file to recognize Qedit files, you need to edit /usr/share/file

login as root

$ cd /usr/share/file

$ qedit

qux/Text magic

qux/Add last

0\tstring\tQEDIT\tQedit                {\t indicates tab characters}

//

qux/Set Decimal On

qux/Change "\t" '9 *                   {change \t to actual tab characters}

qux/Keep

You can now use the file command on these files.

$ file myfile1*

myfile1:       ascii text

myfile1.work:  Qedit


Running Qedit under Linux

Running Qedit

To run Qedit for Linux, type this command:

/opt/robelle/bin/qedit

Qedit. Copyright Robelle Solutions Technology Inc. 1977-2001.

(Version cd ) Type ? for help.

qux/

Qedit prints its version number and prompts with "qux/". You type commands, ending each with Return. For example, to edit a file enter a Text command:

qux/text filename

To save your edits, use the Keep command.

Edit Several Files at Once

Qedit's primary scratch file is called "Qeditscr." By default, this file is created in /var/tmp (/usr/tmp is the default on older versions of Linux) or the path name specified in the TMPDIR environment variable. The scratchfile name is qscr.xxxxxxxxx where "xxxxxxxxx" is a random string generated by the Linux tempnam routine.

 If you want to move scratch files to a different directory, you can set the TMPDIR environment variable.

TMPDIR=/home/user1/tmp

export TMPDIR

Keep in mind that Qedit works with absolute filenames and these names can not have more than 240 characters. Whenever you use the default options for Opening or Texting a file, your work will be in the Qeditscr scratch file.

How to Edit Several Files?

What if you want to edit two or more files and copy lines between them? You could Text the first file, Hold the selected lines, Keep your changes, then Text the second file and insert the lines. However, if you are doing numerous edits, the constant Text and Keep operations are inconvenient.

It is faster to Text each file into an extra scratch file of its own. Then use the "Open ?" or the "Open *-n" command to switch quickly between them. By default, Text always copies the file into the Qeditscr scratch file. However, Qedit can supply up to eight extra scratch files. To Text a file called abcd into an extra scratch file, type:

qux/text abcd,new

When you Exit, Qedit checks whether you have any unsaved edits in any of your scratch files. If there are some unsaved edits, Qedit prompts you to "Discard?" them or to stay in Qedit to save them with the Keep command.

Starting a New Scratch File

Sometimes you start editing a new document and have nothing to Text to create the extra scratch file. In this case, use the New command without parameters.

/new

Qedit creates a new extra scratch file and assigns it a sequential number (1,2,3...). If you use an Open ? command, you would see "Extra Scratch file #2" in the list of files. If you do a Keep or Set Keep Name command, you would see the Keep file as the Text name in Open ?.

Configuring Different Shells

When you log on to Linux, a program is run called the shell. The shell program interprets commands, executes them, and controls command execution. Making configuration changes requires that you know which shell you are using and what files are automatically executed.

Bash Shell

The BASH shell on Linux is the default shell on most versions of Linux. The Bourne Again Shell, is named as such in tribute to Steve Bourne’s shell.

The BASH shell executes the file /etc/profile and your local cd / .bash_profile when you log on to Linux.

Setting Up a PATH for Qedit

You can invoke Qedit with the command:

/opt/robelle/bin/qedit

If you want to be able to just type

qedit

to invoke Qedit/Open, you must either add /opt/robelle/bin to your PATH or copy /opt/robelle/bin/qedit to a directory that is currently on your PATH. Similarly, the man pages for Qedit are found in /opt/robelle/man/man1/qedit.1. To make the man pages available to everyone, you can either add /opt/robelle/man to your MANPATH or you can copy the man pages to a directory that is currently on your MANPATH.

Bash Shell

The easiest way to change the two PATHs for all users on your Linux machine is to log on as root and add these two lines to the file /etc/profile after any existing PATH or MANPATH statements:

PATH=$PATH:/opt/robelle/bin

MANPATH=$MANPATH:/opt/robelle/man

Remember to delete any PATH or MANPATH settings in /etc/d.profile, so that new users do not override your changes. You also have to warn existing BASH shell users to change the .bash_profile file in their home directories.

Qeditmgr Configuration Files

When you run Qedit, it automatically "uses" two configuration files if they exist: /opt/robelle/qeditmgr and .qeditmgr in your home directory. The system manager usually creates /opt/robelle/qeditmgr and puts Qedit commands in it to set Qedit options. To check the options for your site, List this file.

If you want a personal Qeditmgr file, create the file .qeditmgr in your home directory. This file is in addition to the global Qeditmgr file which is always executed first.

Default Set Commands

Qedit treats the Qeditmgr file exactly like a usefile, so Qeditmgr can include any Qedit commands. The Set commands let you configure Qedit so it has the ideal defaults for your shop (e.g., Set Lang Cobol ...). Here is a typical Qeditmgr file:

{These are default qedit values for all users:}

set lang cobolx all on

set x date list off                    {mark changed lines with date}

set check on                           {verify delete/format of >5 lines}

set list page on                       {lp listings interpret $page}

z=list */last                          {define z command}

For details on Set commands, refer to the "Qedit Commands" chapter.

If one set of defaults is not appropriate for everyone on your system, it is possible to set up personal Qeditmgr files in each user's home directory. See the chapter "Running Qedit on Linux" for details.

On-Line vs. Batch Access

You normally run Qedit as an on-line session. You type Qedit commands on your terminal and Qedit prints responses on your terminal. If you redirect stdin or stdlist, Qedit assumes that it is in batch.

Qedit in batch is almost identical to Qedit on-line, except for answering questions. When Qedit asks a question in batch, no one is there to answer it. Therefore, Qedit does not expect an answer from stdin. Qedit assumes that you want your batch task to complete, so it always selects the option that will complete the command successfully. This is normally a "YES" answer, as in "yes, clear the file" or "yes, upshift the line". Qedit prints the question on stdlist, as well as the answer that it has selected for you.

When Qedit encounters an error in batch, no one is there to correct it. Therefore, Qedit normally aborts. However, you can use Set Autocont On to override this abort, instructing Qedit to keep processing after errors in batch.

Command Line Options

You can invoke Qedit/Open with options, or an initial file name to edit, or both (or neither). The syntax for invoking Qedit/Open is:

qedit [-csv] [filename]

See below for suggestions on setting the EDITOR environment variable so that Qedit is automatically invoked as your editor from other tools like elm.

Initial Command Line:  -ccmdstring

You can specify commands to be executed using the -c option before the file name. The -c is followed by commands to be executed. There must be no space between the -c and the command list.

If those commands contain a space, they must be enclosed in single or double quotes; otherwise, the quotes are optional. When both -c and a file name occur, the –c commands are executed after the file is accessed for editing. Here are some examples:

qedit -cvisual myfile

qedit -c"visual" myfile

qedit -c'set vis ab 3 bel 12;visual' myfile

qedit -c"text abc;use fixit;k,y;e"

Editing a Single File:  -s

Sometimes you want to invoke Qedit for a specific purpose, such as writing a message in elm. You are using Qedit as a dedicated tool for a specific purpose. In these cases, specify -s and a file name. You can only edit that file and it will be saved on exit. You will not be allowed to edit any other files.

qedit -cvisual -s myfile

/exit

Save your changes (yes/no)?

Exit with Verify:  -v

Some users find that they Exit from Qedit inadvertently by pressing F8 too many times. To require user approval on Exit, use the -v option.

qedit -v

/e

Okay to exit [no]:

/

"Discard Changes?" on Exit

Qedit needs to purge your random-named scratch files when it terminates. But you may not have saved your editing work yet. In that case, Qedit asks you "Discard changes?" and will not Exit/Purge unless you answer Yes:

qedit myfile

/visual

/exit

Discard your changes [no]:

/

Linux Notes

This section describes features of Qedit/Open that interact with the Linux environment.

EDITOR Variable

Linux utilities that invoke an external editor use the variable EDITOR to determine which editor and run-time options are invoked. The electronic mail tool elm is an example of a utility that uses an external editor to write all messages.

If you want to use Qedit as your standard editor, you need to set the EDITOR variable. We recommend using the -s option for application use.

BASH Shell:

$EDITOR="qedit -s";export EDITOR

Scratch File

When Qedit needs a disposable scratch file (e.g., for Text or Add), it creates a Qedit format file in /var/tmp by default (/usr/tmp is the default on older versions of Linux) or the path name specified in the TMPDIR environment variable. The scratchfile name is qscr.xxxxxxxxx where "xxxxxxxxx" is a random string generated by the Linux tempnam routine.

Keep in mind that Qedit works with absolute filenames and these names can not have more than 240 characters.

Because all Linux files are permanent, Qedit must purge this scratch file when you exit Qedit. If you have made any changes, Qedit asks whether you want to discard the changes that you have made.

Hold Files

Qedit has two Hold files: Hold and Hold0. The first one is created using the Hold command.

Lines are written to the Hold0 file every time you move or copy with the Add command.

By default, these Hold files are created in /var/tmp (/usr/tmp is the default on older versions of Linux) or the path name specified in the TMPDIR environment variable. The Hold files are called qholdxxxxxxxxx (explicit Hold) and qholdxxxxxxxxx.0 (implicit hold file) where "xxxxxxxxx" is a random string generated by the Linux tempnam routine.

If you want to have these files in a different location, you can set the TMPDIR environment variable to the new path name.

TMPDIR=/home/user1/tmp

export TMPDIR

Keep in mind that Qedit works with absolute filenames and these names can not have more than 240 characters. So that you don't have to remember these names, you can refer to these files as Hold or Hold0 in Qedit commands. For example,

/hold 50/60                            {save lines in the Hold file}

/open report.cob                       {switch files}

/aq last=hold                          {lines copied from the Hold file}

The value of TMPDIR can be a relative or absolute path. Internally, Qedit always uses the absolute path. It converts the relative path if needed.

You cannot use Qedit to look at files in your current directory called hold or hold0, unless you qualify them with the directory or a relative path name, as in ./hold.

The Hold files are removed when you exit Qedit.

Shell Commands

You can execute shell commands by typing them at anywhere you can type a Qedit command. If Qedit determines that it is not one of its own commands, it assumes it's a shell command and tries to execute it as such. If the shell command matches an existing Qedit command, you must precede it by a colon (:) or an exclamation mark (!). Shell commands are executed by your default shell (the one configured in /etc/passwd for your user name).

If you want to enforce the use of the colon or exclamation mark prefix, you can enter Set Limits Colonreq ON.

Shell commands are executed by a child copy of your shell. Child shells cannot change environment variables in the parent's environment. To change the value of an environment variable, you must first exit Qedit.

Tab Stops

The default Qedit/Open tab stops are every 8 characters. You can override this using Set Tabs Stop n (every 2 to 15 characters). If you Exit from Qedit with the tabs set to anything other than Set Tabs Stop 8, Qedit resets your terminal to the default tab stops.

When you Text or List a file with tab characters in it, Qedit/Open does not expand them to spaces. If you want to expand tabs into spaces when Texting a file, use the Expandtabs option:

/text abcwork,expandtabs

Control Characters and stty

Most Linux environments have Control-D configured as the end-of-file character. If you use Robelle-style modify, you must reassign Control-D to a different control character.

stty eof “^E”

Another character you may want to have available in Set Mod Robelle is Control-V, which is split a line, in order to allow for that, you may need to use stty to change the lnext, so something other than Ctrl-V.

stty lnext “^K”

 

Hardcoded File Names

Some file names are hardcoded into Qedit. This section describes these file names for Qedit/Open.

/opt/robelle/qeditmgr

This is an optional file that is designed to contain configuration commands. You cannot change this file name. Even if you move Qedit/Open to a different directory, Qedit/Open still looks for /opt/robelle/qeditmgr as the default configuration file.

$HOME/.qeditmgr

In addition to the system wide /opt/robelle/qeditmgr, each user can have a personal (optional) configuration file. When you invoke Qedit/Open, it reads commands from the file .qeditmgr in your home directory.

Variables that Drive Qedit

ROBELLE Environment Variable

Qedit looks for the files it needs in the /robelle directory. Normally, Qedit is installed in /opt/robelle. For example, the Qedit server expects to find its log files in a subdirectory called log/qedit. It would expect to find the error log file in

/opt/robelle/log/qedit/error.log

which is the default full path name of the error log. If you install Qedit in a directory other than /opt/robelle, Qedit should be able to determine the new location and adjust the path for its support files

If Qedit is unable to correctly determine its current location, it is going to revert back to /opt/robelle.

If you wish to use a specific path explicitly, you need to set the ROBELLE environment variable to the new directory. For example,

ROBELLE=/usr/apps/robelle

export ROBELLE

There are two limitations to the path name: the full path name of the file must be no more than 240 characters, and the path name to the /robelle directory must be no more than 219 characters. A slash mark (/) is optional at the end of your ROBELLE environment variable. To set up the log files in the new directory, you have to manually create the "log" or "help" subdirectory in the alternate search path.

So, in order to determine the location of support files, Qedit goes through the following:

·         Uses the ROBELLE variable, if it exists.

·         If the ROBELLE variable does not exist, Qedit tries to identify the location it is running from and, if successful, determines the location based on that information.

If the information from the previous steps is not available, Qedit assumes the files are in the /opt/robelle directory.

QEDCURWFILE Variable

Qedit updates a variable, QEDCURWFILE, with the name of your current or last workfile. This gives you the ability to reference the current workfile easily from within a shell script without having to pass it in as a parameter.

Converting Qedit Files with qcat

Qcat is a filter program similar to cat and zcat. Qcat reads a set of Qedit files and prints the lines on standard output. Type man qcat for more information.

qcat QeditFile > TextFile

Differences Between MPE and Linux

We have tried to make the MPE and Linux versions of Qedit as compatible as possible. This section describes how Qedit/Open is different from Qedit/MPE.

Open/Shut

Qedit/Open uses three forms of workfiles: original, Jumbo, and Wide-Jumbo. The Wide-Jumbo format is new and is used for most files on which you use the Text command. On Linux, the original format is unable to save some information about your file (due to technical differences in how the Qedit workfiles are stored on MPE versus Linux). Once you shut an original file, the following is lost:

·         The name of the file from which you texted.

·         The current line number.

·         The ability to immediately reopen the file and "Undo" changes.

·         The settings for Set Left and Set Right.

For these reasons, Wide-Jumbo workfiles will be the standard in Qedit/Open.

Current "*" File Name

Qedit/Open does not allow substitution of the current file name into shell scripts and commands, because the asterisk (*) is an important substitution character in Linux. For example,

/cc *

cannot compile your current file. Instead, it compiles all files in your current directory.

Missing Features

The following features do not work in Qedit/Open:

·         Beginfile/Endfile commands.

·         Hints are not available.

·         Verify to a line printer.

·         Any MPE-style command such as :Pause, :Run, etc.

·         Proc command, except for Up and Down.

·         I/O redirection of Qedit commands.

·         Spell and Words commands.

·         Out= option of the Listredo command.

·         User Defined Commands and command files.

·         The QEDITCOUNT variable



Qedit Issues and Solutions

Files without NewLine Characters

On Linux, files can contain NewLine (nl) characters at the end of each line. However, the NewLine characters are optional. Some files have them. Others don't.

Qedit/Open requires that lines be separated by a NewLine (NL) character. If that's not the case, Qedit/Open assumes the file does not contain anything. Thus, the Text command might display:

/Text longfile

'Language' is now DATA

0 lines in file

If you run into this problem, you have to find a way to insert these NewLine characters in appropriate places and break the file into manageable pieces.

Starting with version 5.3.13 of Qedit/Open, you can use the Length option of the Text command. This option allows you to specify the maximum size in bytes of each line. The file will be split in a number of same-size lines except the last one if the total size of the file is not evenly divisable by the specified length.

If the file contains Newline characters, these characters are processed as data. You should be very careful when editing such files. If you inadvertently remove one or more of these characters, other programs might have problems using the file again. Since Newline characters causes terminals to move to the next line, we recommend that you use the $Char or the $Hex option on List commands.

For example, to break a file into 80-byte lines, you should use:

/Text longfile,length 80

Another way to accomplish this is by using the fold command.

fold -w 80 longfile > shortfile

In this example, the file longfile is broken down into fixed-length lines, each line containing a maximum of 80 bytes. The result is written to a new file called shortfile. It is then possible to edit the new file using Qedit/Open.

Once you have made all the necessary changes, you can put the short lines back together by removing the NewLine characters. You can use the UNIX awk to perform this operation.

awk -v ORS="" '{ print $0 }' shortfile > longfile

The Output Record Separator (ORS) argument is used to specify the character to be inserted between lines. In this case, you don't specify any.

Because of a limitation in awk, you cannot assemble lines with more than 3,071 bytes. So, you have to remember not to exceed this maximum in the fold command.

Another option is to use the UNIX tr command and remove all Newline characters.

tr -d "/n" < shortfile > longfile

Lines, Strings and Ranges

Character strings can be used of line numbers to qualify lines on most commands. In its simplest form, a command can have a single string using all the search window defaults.

/List "enhancement"

The search string can be further qualified using temporary window settings as in:

/List "enhancement" (Upshift 20/50)

This example searches for the word enhancement regardless of the case used in columns 20 to 50.

Qedit allows up to 10 search strings on a single command. Individual strings are separated from each other with the OR keyword. Each string can have its own temporary window.

/List "enhancement" (U 20/50) or "bug" or "customer" (1/30)

The search range can be different depending on the command it is used on. For example, a List command searches all the lines in the file by default while a Find command starts from the current line. The search range can be specified on individual commands using a rangelist. A rangelist is often specified using line numbers (absolute or relative), special keywords (First, Last, All) or characters (@, *, [, ]). To define a block of lines, the user can enter 2 line numbers separated a slash "/" e.g. 1/6.

It is also possible to define a block of lines using a string range. This syntax allows the use of strings to define the start and end of the range. A string range can also be combined with a numeric line range to further define the block. Here are some examples:

/List "start-proc" / "end-proc"

/Change "a" "b" "start-proc" / "end-proc"

/Delete "start-proc" / "end-proc" 20/100

The List command above finds the first occurrence of start-proc in the file and uses it as the range start location. It then finds the first occurrence of end-proc starting from the start location. It uses that line as the range end location. Finally, it lists all the lines between the 2 locations. By default, List starts at the beginning of the file.

The Change command above replaces all occurrences of the letter a with a b in the lines between (and including) start-proc and end-proc. By default, Change starts at the current line.

The Delete command above removes all the lines between (and including) start-proc and end-proc found in lines 20 to 100. By default, Delete starts at the beginning of the file.

A string range does not behave like a rangelist e.g. 1/20 in all cases. For example, the first statement is not a valid construct with the second statement is.

/Delete "bug" "start-proc"/"end-proc"

Error: Linenum

/Delete "bug" 10/30

You can use the Find command and the ZZ marker to work around the problem. If you enter a simple strings on a Find command, Qedit stops at the first string occurrence and sets the current line. You can then perform any  operation on that line or use it as a starting point. If you specify a line range, the Find command sets the ZZ marker to the block of lines. You then use the ZZ marker on subsequent commands.

/F "start-proc" first

   5     Start-Procedure.

      (1)^

/F "start-proc"/"end-proc" first

Lines 5/11 saved in ZZ

/Delete "bug" zz

    8    _bug-display-section.

1 line Deleted!    


Qedit Commands

Introduction

Qedit/ Linux operates in Line mode on Linux. We are investigating Screen mode for the Linux version. We are interested in getting information about the environments you would be using Qedit in.

Here we describe the Qedit commands in alphabetic order. For each command, we show both the longest and the shortest name that Qedit can recognize, as in Add [A]. Highlighted terms (e.g., linenum) and jargon words (e.g., "workfile") are defined in the "Glossary".

General Notes

Here are general guidelines that apply to using the Qedit commands.

Abbreviations

Each Qedit command has a name such as List that you can abbreviate to any leading subset. Thus, L means List. Some commands require more than one letter: GARbage, DEStroy, RENumber, SHut. You may append option letters to the command: Q, T, or J. Q means "quiet", T means "template", and J means various things, depending on the command.

list all     {fully spelled out}

l @          {maximal abbreviation}

lq           {list quietly}

listqt       {list quietly, with template}

lqjt         {list quiet, jumping, with template}

list $       {most recent external file name}

 

s dec on     {Set Decimal command}

sh           {Shut command}

Uppercase or Lowercase

You can enter the commands in uppercase or lowercase. Shell commands such as ls and cd can only be in lowercase. These commands are identical:

LIST ALL    {uppercase}

list all    {lowercase}

Multiple Commands per Line

You can enter several commands on a single line, if you separate them with semicolons. The maximum command line is 256 characters, and \ is not supported for continuation. If you want to have an Linux command or a calculator command in the stack, you should enclose it in parentheses. This prevents Qedit from passing the rest of the line as parameters. For example,

List 5;!find . -name testfile -exec cat {} ;     {fails}

List 5;(!find . -name testfile -exec cat {} ;)   {works}

If the syntax requires semicolons and parentheses, you have to put the problematic command in a shell script and use it in the command list instead.

Any error causes Qedit to flush the remaining commands in the line.

list 505;add *-1   {list line 505; add just before it}

shut;who

When combining Qedit commands, be certain to use the same quote character in all the commands.

Wrong:

/c7/7"DISPLAY";c\.\\

Right:

/c7/7"DISPLAY";c".""

Comments on Command Lines

You may annotate Qedit commands by putting comment text in curly braces at the end of the line:

keep sample,yes    {update disc file}

Such comments are recognized at the "/" prompt, in usefiles, Next? prompt and List's More? prompt.

Stopping Commands with Control-Y

You can stop most Line mode functions by pressing the Control-Y key. For example, to stop an inadvertent List ALL, use Control-Y. To stop the Add, Modify, or Replace commands, use either Control-Y or two slashes (//).

Implicit Commands

Some commands have no alphabetic name. In Line mode, pressing only Return means display the next line and a backslash (\) means display the previous line, $ means enable Memory Lock and $- means disable Memory Lock. In either mode, ? means Help, any line number means go to that line, a string means display the next line with that string, and "^" means search backwards for a string:

 

55

find and display line 55 or higher

FIRST

find and display first line

;;;;

display the next 5 lines

\

display the previous line

-5

move current line back 5 lines

"string"

display next line with string

^"string"

display previous line with string

$

turn on memory lock at this line

$-

turn off memory lock

 

Shell Commands

Qedit accepts most Linux commands and scripts. If the shell command matches an existing Qedit command, you must precede it with a colon (:) or an exclamation (!). See Running Qedit on Linux for more details.

Calculator Commands

Any command that begins with an equal sign (=) is treated as a calculator expression. This feature can be used to compute temporary values and do conversions from one number base to another.

=64,O

Result= %000100


Add Command [A]

Adds lines into the workfile. There are five varieties of Add that cover all the ways you can add lines into a Qedit workfile:

 

NEW

Add new lines to your workfile from Stdin.

STRING

Add a new line from the command prompt.

COPY

Copy lines from one place to another.

MOVE

Move lines from one place to another.

FILE

Bring lines in from an external file.

 

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

If you do not have a named workfile Open when you Add, Qedit automatically builds a temporary workfile for you. This file has a random file name and is created in /var/tmp by default. If you want to have temporary files in a different directory, enter the new path name in the TMPDIR environment variable.

TMPDIR=/home/user1/tmp

export TMPDIR

Keep in mind that Qedit works with absolute filenames and these names can not have more than 240 characters.

If you make any changes to the file (e.g., by adding lines), Qedit will ask if you want to save your changes when you exit.

Using the Tab Key

By default, Qedit defines tabs every 8 columns across the line (every 10 for Qedit/MPE). 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 a String as a Line)

Add one new line, with the text coming from a string in the command itself. This is handy when you need some literal text within a User Command or Use file, but don't want to create a temporary file to hold it.

ADD linenum string

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

(Default: linenum = *)

The linenum parameter specifies where to insert the new line containing the string.

Examples

/add 5 "new line"

   5.1    new line

/add 10.01 "change datasetdata setall"

  10.01   change datasetdata setall

Add (Copying Lines within a File)

Add lines by copying duplicates of existing lines.

ADD linenum = rangelist

(Q=no display)

(Defaults: none)

The linenum parameter tells Qedit where to insert the copied lines. The number of decimal places in linenum tells Qedit how finely to number the new lines:

/add 50 = 1/9           {new lines will be 50.1, 50.2, 50.3...}

/add 50.10=1/9          {new lines will be 50.10, 50.11, 50.12...}

The rangelist parameter tells Qedit which lines to copy:

/add 50.1 = 1/9 10/15 {'1/9 10/15' is the rangelist}

Examples

/list 4/8               {how lines look before the copy command}

    4     aaaaaaaa

    5     bbbbbbbb

    6     cccccccc

    7     dddddddd

    8     eeeeeeee

/add 5 = 7/8            {copy lines 7 and 8 after line 5}

    5.1   dddddddd

    5.2   eeeeeeee

2 lines COPIED

/list 4/8               {how lines look after the copy command}

    4     aaaaaaaa

    5     bbbbbbbb

    5.1   dddddddd

    5.2   eeeeeeee

    6     cccccccc

    7     dddddddd

    8     eeeeeeee

 

/aq 5 = 5               {duplicate line 5 after itself}

Notes

Add prints each new line, unless you use AQ. When you copy lines, the rangelist must not include the linenum (e.g., /Add 5 = 4/6 is rejected because it would be an infinite loop). Qedit prints "Error: Already". The lines copied are not deleted from the original location. You now have two copies of the lines (and a copy in the Hold0 file, see Add-Move).

If you have Set Left/Right margins, Qedit prints only the portion of each line within the margins. However, it will actually copy the entire line, including the portion outside of the current margins.

Add (Moving Lines within a File)

Move some lines from one place in the file to another, deleting them from the original position.

ADD linenum < rangelist

(Q=no display)

(Defaults: none)

The linenum tells Qedit where to move the lines. The number of decimal places in linenum determines the line number increment. For example, "/add 5.10<100/200" creates lines 5.10, 5.11, 5.12, etc.

The rangelist tells Qedit which lines to move. Add deletes the original lines after moving them. You still only have one copy of each line.

Examples

/list 4/7         {how lines look before the move}

    4     aaaaaaaa

    5     bbbbbbbb

    6     dddddddd

    7     cccccccc

 

/add 5 < 7        {move line 7 after line 5}

    5.1   cccccccc

1 line MOVED

 

/list 4/7         {how lines look after the move}

    4     aaaaaaaa

    5     bbbbbbbb

    5.1   cccccccc

    6     dddddddd

Notes

Control-Y during a move stops the move, but it also changes the move into a copy. The lines being moved in the current range are not deleted.

Add-Move ignores Set LEFT/RIGHT margins; it moves entire lines. However, it only prints the portion of the line within the current margins.

When you copy or move lines using Add= or Add<, Qedit first puts the lines into a "Hold" file called Hold0. It then counts the lines. If you do not have sufficient line numbers to insert the new lines, Qedit stops and prints "Error: Already". Use Renum to renumber the range of line numbers and then copy the lines from the Hold0 file. See also the Hold command.

/list hold0

/add 55=hold0     {add from Hold file}

Add (Copying Lines Between Files)

Add lines to the workfile from an external file.

ADD linenum = filename [,UNN] [ rangelist ]

(Q=no display)

(Default: entire file)

The linenum tells Qedit where to begin adding the lines from the external file.

The filename tells Qedit which file to copy from. It can be any type of disc file. If any of the lines are too long, they will be truncated with a warning. Use filename,UNN when you are adding from a data file with numeric characters in the last eight columns which are not really sequence numbers.

The rangelist tells Qedit how much of the file to copy. The default is to copy the entire file. If the external file does not have sequence numbers, Qedit assumes that the file is numbered from 1 by the current Set Increment. When you specify a rangelist, Add leaves a copy of the lines from the external file in the Hold0 file, as well as in your workfile.

Examples

/add 500.01 = abc       {copy in the file ABC after 500.01}

  500.001 abc line-1    {prints each line copied from file}

  500.002 abc line-2    {prints new line numbers too}

 

/aq 5 = xyz 5/10        {copy in lines 5/10 of the file XYZ}

 

/l template "$page"(up) {list page breaks in a file}

    1    $PAGE "xx"     {select the template you want}

   24    $PAGE "yy"

   37    $PAGE "zz"

/add 5=template 24/36   {copy the lines between $pages}

 

/shut /dev/src/test.c   {establishing "previous" file}

/new cust               {open another file}

/a 1 = $ 50/60          {$ stands for /dev/src/test.c}

Notes

Add prints each line as it copies it, unless you use AQ. If Qedit finds invalid sequence numbers in a file, it begins assigning "logical" sequence numbers using the last valid sequence number and the current Set Increment.

If you have Set Left/Right margins, Qedit inserts blanks before the left margin in each line. That is, the lines from the external file are left-justified within the current margins of the workfile.


Append Command [AP]

Appends a string to the end of each line in the rangelist.