User Guide to the Schulenberg "Q" Text Processing System
========================================================
 
Introduction:
=============
This editor has been designed to emulate the core editing features and behaviors
of the DOS-based Microsoft "M" editor (M.EXE) that dates back to the late 1980s.
Some changes to the keyboard and shortcut assignments have been made because of
the fact that QuickWin application programs generally cannot "see" the ALT and
SHIFT keys as individual keystrokes. Instead, the CTRL key, cursor keys, and the
function keys are relied upon exclusively.  Although this new editor is truly a
Windows program, it preserves the keyboard-style interface and does not use a
mouse at all. It is designed for those programmers who need a powerful text
editor that is easy to learn and use, and which is ideally suited to a command
line environment. Furthermore, DOS (command line) commands can be executed from
within the Editor, maximizing the amount of work that can be accomplished without
exiting from the Editor.  This program was written in Fortran and compiled by the
Intel(TM) Composer XE 2011.
 
Basic Features:
===============
(1) The Editor will handle up to two files simultaneously, whose total text
    size is 750MB or less, where the total number of text lines in each file
    is less than 50 million, and where the maximum length of any text line is
    less than 4096 characters. Furthermore, its "index" file (INDEX.QED) can keep
    track of (and maintain previous versions for) up to 10,000 files that have
    been previously accessed from the Editor. These limits are easily extended.
 
(2) The Editor will let you rapidly flip between two active files. The F2 key
    (or the TAB key) is used to access the "other" file. This feature facilitates
    seeing minor differences between two files, copying and pasting text between
    two files, comparing a file against its formatted version, or switching
    between a file and its DIFF "history".
 
(3) You can use "wildcards" to view or edit groups of files. Simply use the
    asterisk (*) character within the file name.
 
(4) The Editor supports Search and Search/Replace operations, including REPLACE
    strings that are "null" (zero length). The searches are case-insensitive,
    but the REPLACE string will be substituted without change. Searches may be done
    in either a forward or backwards direction starting from the current file
    position. REPLACEs begin at the current file position and go to the end of
    the file.
 
(5) The Editor supports Copy, Delete, and Paste operations using a highlighted
    block of text. The highlighting is done by typing ctrl A and then using the
    > (right) and v (down) cursor keys to define a rectangle of highlighted text.
    You then use ctrl X to delete the block, or ctrl C to copy the block, and
    finally you use ctrl V to paste the block at the desired location in the
    same file ... or a different file.
 
    The Block Shift capability uses this same technique to mark out a block of
    text, but then the ctrl > (right-cursor key) will shift the entire block one
    column to the right, while the ctrl < (left-cursor key) will shift the entire
    block of text one column to the left. A Block Shift operation is concluded by
    using the ESC key to cancel the highlighting. This feature gives the "Q"
    Editor true column editing capability.
 
(6) The Editor supports entering text in languages other than English. To generate
    a letter with an accent, first type the "base letter", e.g., "a", then type
    ctrl Z successively to cycle through all of the accented variants of that base
    letter, e.g., "","","","","","","", etc. There are also alternatives fpr
    consonants like "c" (), "d" (), "m" (), "n" (), "p" (), "s" (,), "z" (),
    and special characters like "$" (,,,,), "?" (), and "!" (). Accented variants
    of many capital letters are supported as well, e.g., "A" (), "C" (), and "D" ().
    Make sure that the cursor is immediately TO THE RIGHT of the letter that you wish
    to generate accented variants for.
 
(7) The Editor makes complete backups of every file that you modify. These
    backups are made "before" you actually modify the file, and they are
    archived in subdirectories named QEDITDIR\BACKUPS. This subdirectory pair
    (QEDITDIR and BACKUPS) is automatically created by the Editor in any disk
    directory in which you have used the Editor to "modify" a file.
 
    The "modified" version of your file is maintained in memory, and is normally
    written back out to disk (preserving your work) only when you exit from
    the Editor (F8 or ctrl E), or when you "switch" to the second/alternate
    file (F2 or TAB). This saving of your work on a file switch is the default
    (Automatic backup mode) behavior, but you can force file saves as often
    as you wish by using the ctrl B command. Ctrl B will cause the modified file
    to be written back out to disk, and the status of your file will then
    revert back to "unmodified". Alternatively, you may wish to turn the
    Automatic mode off for a while so that you do not make too many backup
    files (each time you make a change to an unmodified file it is backed up
    again), e.g, during a period in which you are repeatedly switching back
    and forth between two files as you perform copy and paste operations.
    You can switch to Manual Mode, or back to Automatic Mode, by typing the
    sequence: ctrl A ctrl B. The current status of the Backup Mode is shown
    on the last line of the screen.
 
(8) The Editor remembers your desired color settings (changed via the F6 key),
    your last Search and Replace strings, your current Backup Mode (Manual or
    Automatic), and also where you were last positioned within each file that you
    have viewed or edited. It also remembers the highest version number of each
    backup file generated for each of your text files. All of this information
    is maintained in a central index file named INDEX.QED and pointed to by
    the environment variable QEDITINDEX. It is EXTREMELY important that you
    set this environment variable up when you install the "Q" Editor, and this
    process is described below. Note that because of this use of a single
    global index file, only one instance of the Editor should be running at
    a time. You will be warned if this condition is violated, and you will
    be given the opportunity to start the Editor anyway in case the previous
    Editor execution had been terminated abnormally.
 
(9) This Editor has a file "LOAD" feature, triggered by the ctrl L key, that shows
    all of the files that you have worked with (viewed or modified) anywhere on your
    computer (in alphabetical order) and allows you to scroll down the screen as each
    file name is highlighted in turn. Pressing the ENTER key will then load that
    particular file. If the file of interest has backed-up previous versions, you can
    then load a previous version by using the ctrl P (Previous) key instead of the
    ENTER key. The Previous versions are those that are stored in the QEDITDIR\BACKUPS
    subdirectory of the directory that contains the file in question.
 
(10) If you have a DIFF.EXE file comparison program installed on your computer,
    and if your PATH system variable permits access to it, then this Editor
    will automatically generate a complete DIFF history for any selected
    file. When you are using the ctrl L (file loading dialog), select the file
    that you are interested in by highlighting it, and then type ctrl D (for
    DIFF history). You can also use ctrl D whenever you have TWO similar files
    loaded. Press ctrl D while viewing the more recent of the two files and
    the Editor will generate a DIFF report that shows the changes between
    the older and the more recent file.
 
(11) The UNDO capability is still rudimentary. If you have made changes to a
    single line, and if you have not yet moved off to a different line, then
    you can use the ctrl U key to revert the edited line back to its original
    state.  If you wish to undo ALL of the changes that you have made to a file
    since your work was last saved (ctrl B, or a F2 file switch if the Automatic
    Backup mode is active), then you can use ctrl DEL and answer Yes (Y) to
    the question about throwing out all of your recent changes. Another option
    is to save the current (corrupted) file under a new name, recover a previous
    version as the "official" version, and then reapply selected changes by
    copying and pasting from the saved file. See the File Recovery discussion
    below for more information on this technique.
 
(12) The Editor supports the typing of DOS commands, permitting you to see the
    results in an output file (CMDOUT.TXT) that is automatically loaded as the
    2nd (other) file. Special capabilities are available when you use the DIR
    command. When this special output file has been generated (letting you see
    current files and subdirectories of your home directory, e.g., DIR ENTER, or
    some other directory, e.g., DIR D: ENTER), you can use the ctrl ^ key ("^"
    = up cursor key) to move UP a directory level, position yourself to a line
    showing a subdirectory and then use ctrl v ("v" = down cursor key) to move
    down into that particular subdirectory, or use ctrl v to "LOAD" a data file.
    See the description for the DOS command for more information.
 
    Note: You can also DELETE files if you are currently viewing the output from
    a DIR command. Simply position your cursor to the line containing the file
    and then type ctrl X (or ctrl Y). You will be asked to confirm the deletion.
 
(13) The Editor shows our current working (home) Directory at the bottom of the
    screen and this defines your default pathname if you simply type the name
    of a file (e.g., myfile.cpp) instead of a fully qualified name (e.g.,
    c:\myprogs\myfile.cpp) when you wish to load a file. You can change the
    default Directory at any time by using the F7 key. This will change
    your working Directory to be that of the currently loaded (active) file.
 
 
Installation:
=============
*** ULTRA IMPORTANT. If you are installing a newer version of the "Q" Editor, be
sure to save your INDEX.QED file and restore it after the new install. NEVER replace
this index file with the null default file that is provided with the zip archive.
 
You should follow the instructions below to set up the PATH system variable and the
QEDITINDEX user variable so that the "Q" Editor can be properly accessed from any
directory on your PC.  You may, however, run the QCONFIG.BAT batch file to set
these variables up temporarily.
 
----------------------------------------------------------------------------------
 
This editing tool consists of the single program file Q.EXE that is contained in
a folder with the following structure. You should copy this folder in its entirety
to one of your hard drives and configure the Editor by setting up the PATH system
variable to point to this folder, and also create an environmental variable named
QEDITINDEX that points to the QEDITDIR subdirectory of QEDIT. The folder structure
is as follows:
 
PATH -------> <QEDIT>         Install this entire folder QEDIT folder on your hard drive.
                Q.EXE         The "Q" Editor executable file.
                QCONFIG.BAT   Batch file to set up PATH and QEDITINDEX variables.
                README.TXT    A copy of this HELP file.
QEDITINDEX ->   <QEDITDIR>
                  INDEX.QED   This master "index" file will be created by the Editor.
                  misc.files  (special Editor files: DIFFOUT.TXT, CMDOUT.TXT, TEMPFILE.TXT)
                  <BACKUPS>   This subfolder will generally remain empty, but identically
                                named folders within your other directories will gradually
                                fill up with backups of your files.
 
So, the QEDIT folder must be referenced within your PATH system variable so that you can
invoke the "Q" Editor from anywhere.  You must also create a QEDITINDEX user variable
that points to QEDIT\QEDITDIR so that the Editor can access the INDEX.QED file that describes
all editing activity on your entire computer (and associated external drives). To edit the
PATH variable, go to the SYSTEM icon on the Control Panel and click the Advanced Tab. Then
select "Environment Variables" and find the PATH variable under "System Variables". Add the
QEDIT directory to the end of the PATH string. Then, add a NEW user variable named QEDITINDEX
and ensure that it points to QEDITDIR, e.g., QEDITINDEX=C:\QEDIT\QEDITDIR\
 
It is also recommended that you download and install a copy of "diffutils". Go to the website
http://gnuwin32.sourceforge.net/packages/diffutils.htm and download diffutils (release 2.8.7).
You do not need the source code, just the binaries. When you have downloaded Diffutils, copy
the following files from the "bin" subfolder to your QEDIT directory (or wherever you installed
the "Q" Editor): diff.exe, libiconv2.dll, libintl3.dll. If the QEDIT folder is referenced by
the PATH system variable then you are all set.
 
 
Nomenclature:
=============
ctrl    The "control" key.
<       The "left" cursor key. NOT the "less than" sign.
>       The "right" cursor key. NOT the "greater than" sign.
v       The "down" cursor key. NOT the letter "v".
^       The "up" cursor key. NOT the character "^".
 
 
Basic Editing (Viewing) Commands:
=================================
PgUP       Move up one screen page
PgDN       Move down one screen page
ctrl PgUP  Jump to first line of file  (also ctrl HOME, also ctrl A PgUP)
ctrl PgDN  Jump to last line of file   (also ctrl END,  also ctrl A PgDN)
<,>.^,v    Move one character left/right/up/down using the cursor keys.
 
HOME       Go to beginning of line (first nonblank character)
END        Go to end of line
 
INS        Insert: Toggle into and out of insert mode
DEL        Delete current character
Backspace  Back up one character
ESC        Cancel a ctrl A initiated operation (Search/Replace and highlighting)
 
Note (1): TABs are supported by this editor in a special way: when any tab characters are
encountered when loading a file, they are automatically converted to the special
character  . If you wish to insert a TAB character within your text, then you must ue
the ctrl T command. ctrl T will generate the   symbol, and when the file is written out
to disk this special character will get converted back to a real Tab (9). Within the
Editor the TAB key itself is used as an alternate shortcut for the F2 key (load/switch files).
 
Note (2): The END key is very useful when you are trying to highlight a block of
text, or a string of text on a single line. If you have started the highlighting
process, pressing the END key will instantly extend the highlighting to the end of
the line ... or to the rightmost text column if you are highlighting a block of text.
 
 
Other useful commands when doing basic editing:
 
  ctrl B         Force a backup when you wish to ensure your work is saved. Normally,
                   a modified file is backed up when you Exit the Editor (F8 or ctrl E),
                   or, if Automatic Backups are enabled, whenever you use the F2 key
                   (or TAB) to look at the other active file ... or to load a second
                   file. If you have disabled Automatic Backups, then you should use
                   ctrl B at key points during your editing session.
 
  ctrl D         View a DIFF report that shows differences between TWO loaded files.
                 You must have two similar files loaded into the Editor, and you should
                 be viewing the more recent file when you type ctrl D.
 
  ctrl E (or F8) Exit from the Editor. This will cause all modified files to be saved.
  Note: If you are doing "wildcard" editing of multiple files (e.g., Q *.cpp), then
  each ctrl E or F8 will sequence you to the next file. If you wish to stop editing
  totally (terminating the wildcard operation), then put the ctrl E or F8 inside
  of an Action string: ctrl A F8   ... or ..   ctrl A ctrl E
 
 
  ctrl L         Call up the File Load dialog to load a file that you have accessed
                   previously. You may also load Previous (backed-up "earlier") versions
                   of a file, or generate a DIFF History of all changes to a file.
 
  ctrl T         Add a TAB character. It will show up as the symbol 	 and will be
                   converted to a real tab character (9) when the file is written out.
 
  ctrl U         UNDO changes made on a single text line (before you move away from the line).
  ctrl DEL       UNDO "all" changes made to the active file since the last time your
                   work was written back out to the disk file, e.g., at the last ctrl B
                   usage, or the last F2/TAB file "switch" (if the Backup Mode is
                   AUTOMATIC).
 
  ctrl Z         Cycle through all available accented variants of the character immediately
                   to the LEFT of the cursor.
 
                 The Editor supports entering text in languages other than English. To generate
                 a letter with an accent, first type the "base letter", e.g., "a", then type
                 ctrl Z successively to cycle through all of the accented variants of that base
                 letter, e.g., "","","","","","","", etc. There are also alternatives fpr
                 consonants like "c" (), "d" (), "m" (), "n" (), "p" (), "s" (,), "z" (),
                 and special characters like "$" (,,,), "?" (), and "!" (). Accented variants
                 of many capital letters are supported as well, e.g., "A" (), "C" (), and "D" ().
                 Make sure that the cursor is immediately TO THE RIGHT of the letter that you wish
                 to generate accented variants for.
 
  F1             Access HELP (this document)
 
  F2 (or TAB)    Switch to the second (alternate/other) file. Two files can be loaded
                   and active simultaneously, and F2 (or TAB) will alternate between
                   them, permitting you to copy and paste or simply search for
                   similarities or differences between the two files..
 
  Ctrl F1        When viewing a file with very long lines, pressing the Ctrl F1 key
                   will shift your view 10 columns to the left.
 
  Ctrl F2        When viewing a file with very long lines, pressing the ctrl F2 key
                   will shift your view 10 columns to the right.
 
  ctrl A ctrl A  filename  F2 (or TAB)    Load the file "filename"
 
  ctrl A line# ENTER         Go to specific line number, e.g., ctrl A 1000 ENTER
 
  ctrl A dos-command ENTER   Execute the DOS command "dos-command", e.g.,
                 ctrl A dir *.cpp ENTER
 
       NOTE: Special capabilities are available if you use the DIR dos-command, e.g.,
         ctrl A DIR ENTER  -- or -- ctrl A DIR C:\MYFILES ENTER, etc.  The use of
         the DIR command will result in the familiar display of files and subdirectories.
         You can then traverse directories and subdirectories easily by using the
         ctrl ^ and ctrl v cursor commands (hold the ctrl key down while pressing
         cursor-up or cursor-down).
 
 
See sections below for information on Line Operations (insert/delete/copy entire text
lines), Searching, Search and Replace Operations, Cut/Copy and Paste Operations,
Block Shifting Operations (shift a block of text left or right), Viewing a DIFF Report
(Chronological History of changes to a file), File Operations, Go To specific line #,
File Recovery techniques, DOS Command Operations, etc.
 
 
Line Operations (delete, copy, or insert entire text lines):
============================================================
ctrl C               Copy the line indicated by the cursor to the clipboard
ctrl X (or ctrl Y)   Delete the line indicated by the cursor and move it to the clipboard
ctrl V (or ctrl INS) Paste the deleted line above the line indicated by the cursor
ctrl N               Insert (N)ew line above the line indicated by the cursor
 
Note: The "clipboard" used for Line Operations is only sized for a single line. If you
delete a single line (ctrl X or ctrl Y) then you can paste it (ctrl V), but if you delete
more than one line then only the "last" line is available for the paste operation. If
you wish to delete or copy multiple lines then you will need to use the ctrl A key to
"highlight" a block of lines. A benefit of the single-line clipboard is that you can
paste the line as many times as you wish.
 
 
Cut/Copy and Paste Operations (use of highlighting):
====================================================
ctrl A (followed by cursor right (>) or down (v) keystrokes). Highlight a block of text.
 
ctrl C               Copy the highlighted text to the clipboard.
ctrl X (or ctrl Y)   Delete the highlighted text and move it to the clipboard.
ctrl V (or ctrl INS) Paste the text saved in the clipboard at the current location shown by the cursor.
END                  Use the END key if you wish to highlight all the way to the end of the lines.
 
ESC                  Abort the cut/copy sequence and cancel the highlighting.
 
Note 1: To highlight a block of entire lines, use ctrl A immediately followed by the v (down)
cursor key. To make a rectangular block, use the ctrl A followed by the > (right) or v (down)
cursor keys, or vice versa. Use the END key if you wish to extend the highlighting to the right
to encompass the rightmost text character.
 
Note 2: If a section of text has been highlighted as the result of a Search operation, then
ctrl X (or Y) will delete just the highlighted piece of text -- and not the entire line as
you might expect. In this case, typing ctrl X a second time will delete the entire line, if
that is what you wish. The general idea is that a highlighted piece of text can be operated
on in a consistent manner, whether the highlighting was done via a Search, or by an explicit
highlighting operation that you performed.
 
 
Block Shift Operations (use of highlighting):
=============================================
ctrl A (followed by cursor right (>) or down (v) keystrokes). Highlight a block of text.
 
ctrl >               Shift the entire block of text one column to the right.
ctrl <               Shift the entire block of text one column to the left.
END                  Use the END key if you wish to highlight all the way to the end of the lines.
 
ESC                  Terminate the shifting operation and cancel the highlighting.
 
Note: To highlight a block of entire lines, use ctrl A immediately followed by the v (down)
cursor key. To make a rectangular block, use the ctrl A followed by the > (right) or v (down)
cursor keys, or vice versa. Use the END key if you wish to extend the highlighting to the right
to encompass the rightmost text character.
 
 
Search/Replace Operations:
==========================
Find a string:    ctrl A  Search-String  F3/F4  (Type ctrl A, then the search string,
                                                 and then use F3 (Prev) or F4 (Next)).
F3  (or ctrl <)   Search for the "previous" occurrence of the string.
F4  (or ctrl >)   Search for the "next" occurrence of the string.
 
Replace a string: ctrl A  ctrl R  Search-String  ENTER  Replace-String  ENTER
 
Shortcuts and Techniques:
-------------------------
(A) If you highlight a section of text by using a ctrl A > sequence (type ctrl A and
then use the right cursor key to extend the highlighting to the right), then you
can simply press F3 or F4 (or the equivalent ctrl < and ctrl > keys) to begin
a search for the PREVIOUS or NEXT identical string.
 
(B) An alternate way of initiating a Search-and-Replace sequence is to begin by
highlighting a piece of text (by using ctrl A and then right-cursor key >) and THEN
typing ctrl R. The highlighted text will then appear as the SEARCH string in the
prompt area at the bottom of the screen, and if you press ENTER then you will see
the REPLACE string (remembered from the last time you did a REPLACE). If you change
the REPLACE string and then press ENTER, then the Search-and-Replace operation will
commence from the line that has the text that you originally highlighted.
 
(C) If you wish to do a Global Search (or Search and Replace), use the wildcard
feature of the Editor, e.g.,
 
     Q   *.cpp    (Activate the Editor for all files with the cpp suffix)
 
This will position you to the first cpp file. You can then do a Search or Search/
Replace within this file. Then, exit by pressing F8 (or ctrl E) to bring up the
next file. Repeat the operation until you have gone through all files. Since the "Q"
Editor remembers your Search and Replace strings, once you have done the operation
in the first file, subsequent operations in other files are much easier, e.g.,
 
    First file:  Type  ctrl A ctrl R search-string ENTER replace-string ENTER
    nth file:    type  ctrl A ctrl R ENTER ENTER
 
Make sure you position yourself to the top of each successive file, however, since
Search and Search/Replace operations always start from the current file position.
Use ctrl HOME or ctrl PgUP to go to the top of any file (and ctrl END or ctrl PgDN
to go to the end).
 
Note 1: The "<" and ">" symbols used above are the cursor left and right keys.
 
Note 2: The Search feature is not case sensitive. Thus, a search for the string
"FlagWord" will find "flagword", "FLAGWORD", "FLAGword", etc.  However, the
REPLACE string "is" case sensitive; whatever you enter for the REPLACE string
will be inserted without any changes. Furthermore, the REPLACE string can be
blank, in which case the Search string is automatically deleted entirely. When
the Search or Replace strings are being input, you can use a ctrl A to chop
off all text to the right of the cursor location. Remember that the Editor
will default you Search and Replace strings to the values that you used
previously. If you wish to input search or replace strings from scratch, simply
press the MOME key and then type ctrl A. This will give you an empty field for
your input.
 
REPLACE operations always commence at the current file location and terminate at
the end of the file ... moving forward through the file.
 
 
GOTO Line# Operation:
=====================
To jump directly to a particular line# in the active file, type the following:
 
ctrl A  line#  ENTER    (example: ctrl A 1050 ENTER)
 
Note that this will only work if the "line#" represents a integer value that is
greater than or equal to 1, and less than or equal to the total number of lines
in the current file.
 
 
DOS Command Operations (and working with the Windows file system):
==================================================================
To invoke a DOS (command line) command, and to see the resulting output, type
the following:
 
ctrl A  dos-command  ENTER
 
    Examples:
 
      ctrl A dir *.cpp ENTER
      ctrl A dir ENTER)
      ctrl A dir C:\myfiles ENTER
      ctrl A erase tempfile.txt ENTER
      ctrl A copy filea.txt fileb.txt ENTER
      ...
 
The results are written out to a file named QEDIT\QEDITDIR\CMDOUT.TXT, and this
file is automatically loaded as the 2nd (other) file so you can see the immediate
results.
 
If you use the DIR (dir) command (for dos-command) then you will see the familiar
directory listing of files and subdirectories within your current home directory.
You can search this report like any other text file (HOME, PgUP, PgDN, ctrl HOME,
ctrl END, ctrl PgUP, ctrl PgDN, etc.), and you can also Copy text into the clipboard,
but you can also do more:
 
   (1) At any time you can press ctrl ^ (up-cursor) to move up one directory level.
   (2) If you are positioned in the output at a subdirectory (<DIR>  subdirectory),
       then pressing ctrl v (down-cursor) will bring up a directory listing of
       the contents of that subdirectory.
   (3) If you are positioned in the output at a file, then presing ctrl v (down-
       cursor) will cause the Editor to "LOAD" that specific file -- unless the
       file is one of the standard type (e.g., doc, docx, xls, xlsx, ppt, pptx,
       pdf, etc.), in which case the Editor will activate standard programs to handle the file.
 
Note 1: You can use the normal variations of the DIR command, e.g., DIR C:\, DIR D:,
DIR C:\myprogs, etc. You can also use other DOS commands like "erase", "copy",
"rename", etc., but these are trickier and Editor support for these is still rather
minimal. You are better off going to a real command prompt to perform these more
dangerous operations.
 
Note 2: The "Q" Editor is designed to give you global viewing and editing capability
for all files on your computer -- no matter which disk drive or directory they are
in. For that reason it supports changing your working (home) directory so that you
can more easily access files using just their basic name (e.g., myfile.cpp) instead
of a fully qualified name. The F7 key will change the current working Directory to
be that of the path of the currently active (loaded) file.
 
 
 
File Operations:
================
Insert (paste) a File:      ctrl A  ctrl A  Filename  ctrl V  (or ctrl INS)
 
View the Help file:         F1
 
Switch to 2nd file:         F2      (or press TAB key)
 
Set Working Directory:      F7      (set current directory to that of the active loaded file)
 
Save all files and exit:    F8      (or use ctrl E)
  Note: If you are doing "wildcard" editing of multiple files (e.g., Q *.cpp), then
  each ctrl E or F8 will sequence you to the next file. If you wish to stop editing
  totally (terminating the wildcard operation), then put the ctrl E or F8 inside
  of an Action string: ctrl A F8   ... or ..   ctrl A ctrl E
 
 
Load a previous file:       ctrl L  (use cursor keys to highlight a file name and press ENTER)
                                    ... or use ctrl P (within ctrl L dialog) to load a
                                        previous (Backup) version.
                                    ... or use ctrl D (within ctrl L dialog) to generate a
                                        complete DIFF history for the file. You must have
                                        DIFF.EXE loaded on your computer and accessible via
                                        the PATH system variable.
                                    ... or use ctrl X (within ctrl L dialog) to remove the
                                        entry from the index file (INDEX.QED), and also
                                        delete any backup files that are associated. This
                                        will NOT delete the real file itself -- only the
                                        data that the Editor has maintained about it.
 
 
Load a specific file:       ctrl A  existing-filename  ctrl L (or F2, or TAB)
 
Create a new file:          ctrl A  desired-filename   ctrl L (or F2, or TAB)(Specify Y to Create)
 
Generate a (B)ackup:        ctrl B  (see Note below for more information on backups)
 
Reload the current file:    ctrl DEL    (UNDO: confirm that current changes should be ignored).
 
SAVE AS                     ctrl A new-name ctrl W    (W)rite active file to disk under a new name
 
SAVE AS (default)           ctrl A ctrl W             (W)rite active file to QEDITDIR\TEMPFILE.TXT
 
Note: A modified file is automatically Saved if you exit from the Editor (F8 or ctrl E),
and if Automatic Backup mode is selected, your work is also saved whenever you press F1 (for Help)
or F2 (or TAB) to view the 2nd file. If you have made extensive changes to a file, you might also
want to use the ctrl B command to force backups at specific points in your editing session.
 
Backups of modified files are automatically generated at F1/F2 file switches if the "Backup: Auto"
is selected. This is the default, and the current setting is shown on the last line of the screen.
However, you can always force a backup at any time by using the ctrl B key. On the other hand,
there may be times when you do not want to have backups made automatically every time you switch
back and forth between two active files, e.g., when you are copying and pasting text between two
files. In this case you may wish to switch to "Backup: Manual" mode for a period of time, and
then return to Automatic Mode later. You can switch back and forth between Automatic and Manual
Backup modes by using the sequence: ctrl A ctrl B.   This will "toggle" the backup mode from
Automatic to Manual, or from Manual to Automatic.
 
 
File Recovery Procedures:
=========================
The "Q" Editor generally saves backup copies of your edited file at a frequent rate. If the
"Backup: Auto" option is in effect, then this will happen every time you press F1 to access HELP,
or use F2 to load a new file ... or to look at the 2nd (other) file that is active. You can also
use ctrl B to make a new backup any time you wish, and if you have switched to the "Backup: Manual"
option, then this is the ONLY time a backup will be made -- until you exit from the Editor.
 
Now, if the Editor crashes, or if you have totally messed up your active file with bad edits, then
you can recover a recent backup file by using ctrl L, finding the name of your file (plus its
latest saved version), loading the saved version, and then using the "SAVE AS" feature to copy over
your corrupted file. The syntax of the SAVE AS command is:
 
   ctrl A  file-name  ctrl W    (the current active file will be (W)ritten out to disk as "file-name".
 
If you have a copy of DIFF.EXE on your computer that is accessible to the "Q" Editor (via the PATH
system variable), then you can examine a complete DIFF history of all recent changes to your file
in order to decide which specific backup version you wish to restore to. Simply type ctrl L, use
the cursor keys (and PgUP/PgDN) to highlight your current file, and then type ctrl D. This will
generate and load the DIFF report for your file.  Use this output to decide which prior version
you need to revert to, then load that file by typing ctrl L, finding your file, and then using
ctrl P to select the "previous" version that you need.  Then, use the SAVE AS command to write
the previous (backup) file on top of your corrupted file:
 
   ctrl A  corrupted-file  ctrl W  (copy the loaded backup file on top of your "bad" file)
 
If you have made a lot of "good" editing changes, as well as the bad ones, then before you revert
to a backup, save the current work as a temporary file. There is a shortcut for this:
 
   ctrl A  ctrl W    (copy the current active file to QEDIT\QEDITDIR\TEMPFILE.TXT)
 
So, the optimal procedure might go like this:
 
  Step 1.  You have grossly messed up the file that you are editing (e.g., myfile.cpp), but you
           have made some good changes that you would like to reapply to a clean file.
 
  Step 2.  Save your messed up file to QEDIT\QEDITDIR\TEMPFILE.TXT:
 
              ctrl A  ctrl W     (you could also pick your own file: ctrl A  temp-file  ctrl W)
 
           This will save your file as TEMPFILE.TXT and load it so that you are now looking at it.
 
  Step 3.  Use ctrl L to find your original file name (e.g., myfile.cpp), and with it highlighted,
           type ctrl D to generate a DIFF report (if you have a copy of DIFF.EXE on your PC). Use
           the DIFF report to decide on which backup you wish to recover to.
 
           If you do not have a copy of DIFF.EXE, or you wish to simply look at some of the recent
           backups, then highlight your file (with ctrl L) and then type ctrl P to load one of
           the (P)revious backups.  Do this until you have loaded the backup that you are going
           to go with, e.g., QEDITDIR\BACKUPS\myfile-0004.cpp.
 
  Step 4.  With the selected backup file now loaded, use the SAVE AS command to overwrite the
           original file:
 
           ctrl A  myfile.cpp  ctrl W
 
  Step 5.  Your new baseline file has now been loaded, has the name "myfile.cpp", and you are
           looking at it, but it DOES NOT contain your recent good (and bad) editing that has
           been saved off as the file QEDIT\QEDITDIR\TEMPFILE.TXT.  So, load this file, either
           by using the ctrl L load procedure, or typing:
 
           ctrl A  c:\qedit\qeditdir\tempfile.txt  F2    (or wherever you put the QEDIT directory).
 
  step 6.  Now, use the F2 function key to switch back and forth between the newly baselined
           myfile.cpp file and the temporary file tempfile.txt, and use Copy and Paste operations
           (aided by the Search command) to reapply the changes that you wish to keep.
 
 
 
 
Function Key Summary:
=====================
F1         Show User Guide
F2         Switch file view (1>2 or 2>1)  (TAB key is alternate for F2)
F3         Search backwards (PREV)        (ctrl <  is alternate for F3)
F4         Search forwards (NEXT)         (ctrl >  is alternate for F4)
F5         Reformat source code (currently unimplemented)
F6         Cycle successively through background/text color combinations
F7         Change Directory. Set working directory to be the same as the current active file
F8         Save modified files and Exit   (ctrl E  is alternate for F8)
  Note: If you are doing "wildcard" editing of multiple files (e.g., Q *.cpp), then
  each ctrl E or F8 will sequence you to the next file. If you wish to stop editing
  totally (terminating the wildcard operation), then put the ctrl E or F8 inside
  of an Action string: ctrl A F8   ... or ..   ctrl A ctrl E
F9         ... RESERVED for customized applications
F10        ... RESERVED for customized applications
F11        ... RESERVED for customized applications
F12        ... RESERVED for customized applications
 
Ctrl F1    Shift your view 10 columns to the left (used for files with long lines)
Ctrl F2    Shift your view 10 columns to the right (used for files with long lines)
 
Command Summary:
================
ESC       Cancel a sequence initiated by the Action Key (ctrl A)
ctrl A    (A)ction Key. Use for compound operations. Will also "chop off" text (from cursor to end of line).
ctrl B    (B)ackup current file (if modified) in QEDITDIR\BACKUPS. This clears the "Modified" status.
ctrl C    (C)opy a line, or the highlighted text, to the clipboard.
ctrl D    (D)iff history generation. This is done within a ctrl L dialog -- OR -- when two similar files
             are simultaneously loaded and you wish to see the differences between them.
ctrl L    (L)oad a file. Will display a list of previously accessed files.
ctrl N    Insert a (N)ew line above the cursor location.
ctrl P    Load a (P)revious (i.e., BACKUP) version. This is done within a ctrl L dialog.
ctrl R    Specify a (R)eplace operation (ctrl A ctrl R search-string ENTER replace-string ENTER)
            -or- use ctrl A to highlight some text and then type ctrl R to begin the sequence.
ctrl T    Generate a "fake" TAB character: 	.  This will be converted to a real Tab (9) when file is saved.
ctrl U    (U)ndo editing changes made on a single line ... as long as you have not moved from the line.
ctrl V    Paste a deleted line or block of deleted text from the clipboard.
ctrl W    (W)rite active file back to disk under a new name (e.g., Ctrl A  new-name  ctrl W)
ctrl X    Delete the current line, or the highlighted block of text, and move it to the clipboard.
ctrl Z    Cycle through accented variants of the character immediately TO THE LEFT of the cursor.
 
ctrl ^    (up-cursor).   Following DOS DIR command (ctrl A dir ENTER), move up one directory level.
ctrl v    (down-cursor). Following DOS DIR command (ctrl A dir ENTER), move down to specified directory
                           level -- or LOAD file -- according to the contents of the line identified
                           by the current cursor location.
 
Note: The ctrl D (DIFF) command can be used in two different situations:
 
#1: Within the ctrl L (file loading) dialog, the ctrl D is used to view the complete developmental
    history of the selected file by comparing pairs of backup versions, starting with comparing version
    1 with version 2, then comparing version 2 with version 3, etc.
#2: Whenever any two similar files are simultaneously loaded. In this case you should be viewing the
    more recent file when you type ctrl D. A DIFF will be run that compares the "other" file against
    the one that you are currently viewing, and the Report will be displayed. You can then see the
    more recent file by pressing F2 (or TAB), and you can then copy and paste from the DIFF report
    into your recent file by using F2 (or TAB) to switch back and forth between the two files.
 
 
Alternative Keys and Shortcuts:
===============================
TAB       Alternate key for F2 (load/switch files)
ctrl <    Alternate key for F3 (search PREV). ALSO, will shift a highlighted Text Block to the left.
ctrl >    Alternate key for F4 (search NEXT). ALSO, will shift a highlighted Text Block to the right.
ctrl E    Alternate key for F8 (Save all modified files and exit)
ctrl Y    Alternate key for ctrl X (delete line or highlighted area)
ctrl INS  Alternate key for ctrl V ("paste" key)
 
 
 
Editor Subdirectories (Backups of Files):
=========================================
This editor will create a subdirectory pair named QEDITDIR\BACKUPS within each directory within
which you have "modified" files. This pair of directories is NOT created if you are only
viewing files within the directory. The directory situation will thus look like:
 
              <user directory>
                user files
                <QEDITDIR>
                  (empty)          should contain no files
                  <BACKUPS>
                    file backups   backups made by "Q" Editor
 
Remember from the Installation Instructions shown at the top of this file that the Installation
directory will look like:
 
PATH -------> <QEDIT>           Install this entire folder QEDIT folder on your hard drive.
                Q.EXE           The "Q" Editor executable file.
                QCONFIG.BAT   Batch file to set up PATH and QEDITINDEX variables.
                README.TXT      A copy of this HELP file.
QEDITINDEX ->   <QEDITDIR>
                  INDEX.QED     This master "index" file will be created by the Editor.
                  (misc.files)  (special Editor files: DIFFOUT.TXT, CMDOUT.TXT, TEMPFILE.TXT)
                  <BACKUPS>     This subfolder will generally remain empty, but identically
                    (empty)       named folders within your other directories will gradually
                                  fill up with backups of your files.
 
There should only be one INDEX.QED file on your entire system, and it should be contained
within the Installation Folder (e.g., C:\QEDIT\QEDITDIR), and there should be a "user
variable" named QEDITINDEX pointing to it. This INDEX file can contain up to 10,000 file names
that summarize every file that you have viewed or modified anywhere on your system. The
ctrl L dialog will allow you to "prune" entries that you do not wish to track, and also
to delete backup files that you do not wish to keep.
 
The backup files are thus maintained within a subfolder that is local to each directory that
contains the original files. This facilitates making backups because all related files stay
together. The centralized INDEX.QED file will keep track of the locations, and highest
version numbers of all backups everywhere, and thus it too should be backed up frequently.
 
The subdirectory named BACKUPS will be created under the QEDITDIR directory whever you first
modify a file in the parent directory, and this will be used to save all versions of your text
files "before" changes are made. If necessary (and ONLY if necessary), you can copy these
backup files to an external disk drive and then delete them to conserve disk space. You will
need to restore them, however, it you need to back up to one of these previous versions --
OR if you wish to generate a DIFF "history".
 
Note that a backup file will be created whenever a file is in an unmodified state and you make
ANY editing change to it ... causing the Modified indicator to be set. If your file is in a
Modified state (i.e., all of your current work is stored in memory ONLY), then you can use the
ctrl B key to force your updated file to be written back to disk ... causing the Modified
indicator to go back to the Unmodified state.
 
Backup files are ALWAYS created each time a file changes from an Unmodified state to a Modified
State. Your new work is only saved, however, according to the following rules:
 
     F8 (ctrl E)     All modified files are written back to disk before the Editor exits.
     ctrl B          The current modified file is written back to disk and the file
                       becomes Unmodified.
 
     If the Backup Mode is "Automatic", then the current modified file is also written back out
     to disk upon:
 
     F1              Load the HELP file.
     F2 (or TAB)     Load a new file, or Switch to the "other" active file.
 
 
The Backup Mode is switched back and forth (toggled) between Manual and Automatic Mode by typing
the sequence: ctrl A ctrl B.
 
 
Note 1: Backed-up files (in QEDITDIR\BACKUPS) can be loaded by using the ctrl L key to see recently
accessed files. Then use ctrl P to load a specific previous Backup.
 
Note 2: If you have a copy of DIFF.EXE loaded on your computer (and accessible to the Editor via
the PATH system variable), then you can use ctrl D once you have highlighted a file within the
ctrl L dialog to see the complete evolutionary history of a specified file (DIFFOUT.TXT).
 
Note 3: You an load BACKUP files to view them, or to copy text from them, but you cannot use the
"Q" Editor to change them. They are effectively "read only" because, after all, they are "backups".
 
Note 4: The CMDOUT.TXT file is generated whenever you use the Editor to execute a DOS command,
e.g., ctrl A dos-command ENTER. The output from the command is piped to the QEDIT\QEDITDIR\CMDOUT.TXT
file and is then immediately loaded as your 2nd (other) file so you can view the results.
 
Note 5: Within the ctrl L (Load) dialog you can use ctrl X (delete) to REMOVE an entry from the
centralized INDEX.QED file. This will also delete any backups that have been made of the file shown,
but it WILL NEVER delete the real file ... only the index entry and any backups that the "Q"
Editor has made. You can perform this "pruning" procedure to keep the index from growing too large
(although it will hold up to 10,000 entries), or to remove files of no real interest from your
list of most-recently-accessed files.
 
 
Screen Colors:
==============
You can use the F6 function key repeatedly to cycle through the various background and text
colors that this editor supports. There are 8 defined color combinations, and the editor will
remember (in the INDEX.QED) file which combination you prefer.
 
 
New Files:
==========
You can create new text files by simply specifing the name of a non-existing file, e.g.,
 
  Q    newfile.txt                    (specify the new file when you invoke the editor)
 
  ctrl A ctrl A  newfile.txt  ctrl L  (or F2)(specify the new file within an Action string)
 
 
Wildcards:
==========
The "*" wildcard character is supported, e.g.,
 
  Q    prev*.txt                   (Edit all files beginning with "prev")
 
  ctrl A ctrl A  prev*.txt  ctrl L (or F2)(Edit all files beginning with "prev")
 
If wildcard edits have been initiated, then each time you press the F8 (EXIT) function key
you will be transferred to the next file in the sequence. The F2 ("other" file) key can be
used to access the file that you had previously been looking at.  By using the wildcard
edit feature you can semi-automate global search and search/replace operations.
 
 
Copying, Cutting, and Pasting:
==============================
This editor is designed to work with up to two files simultaneously. You can switch between
the two files by using the F2 key, and the internal clipboard (NOT the Windows clipboard)
will facilitate copying and pasting between the two active files.
 
Entire new lines can be added (ctrl N), deleted (either ctrl X or ctrl Y), copied (ctrl C),
and pasted (ctrl V or ctrl INS), but the clipboard for these simple edits is only a single line.
In other words, if you delete a line (ctrl X) and then paste it (ctrl V) somewhere else, then this
will work as expected. If, however, you delete two lines with ctrl X, then only the second line
will be "remembered" when you do the paste (ctrl V) operation. To delete or copy blocks of lines
you need to use the advanced copy/paste procedure that is initiated by using the "Action" key
(ctrl A).
 
If you position the cursor within the text (using PgUp, PgDn, Home, End, and the cursor keys)
and then type ctrl A, then as you use the left/right or up/down cursor keys you will see a
highlighted block of text. You can then Copy this text via ctrl C, or delete it via ctrl X,
and then paste it somewhere else with ctrl V (or ctrl INS). Use the ESC key to cancel such an
editing operation. Note that you can copy a block of text from one file and then "switch" to
a second file (using F2 or TAB) and paste it there.
 
 
Search and Replace:
===================
The Search feature is currently case-insensitive, but a REPLACE string will be utilized "as-is"
(i.e., without changing case).
 
A Search is started via the Action Key (ctrl A). Type ctrl A and then type in your search string.
Then press F4 to search for the NEXT occurrence of that (case-insensitive) string, or use the
F3 key to search for the PREVIOUS occurrence of that string. You can use a second ctrl A key
to "chop off" all text to the right of your cursor.
 
You can also initiate a Search by highlighting some text (use ctrl A followed by use of the >
cursor) and then pressing either F3 (PREV) or F4 (NEXT).
 
To do a Search and Replace operation, type ctrl A ctrl R (the "R" stands for (R)eplace. Then
type in your search string and press the ENTER key. You will then be prompted for the Replace
string. Type it in and press the ENTER key again. The text substitutions will take place from
your current cursor location to the END of the file. The ESC key can be used to cancel the
Search/Replace operations, and a ctrl A at any point will chop off all text to the right of
the cursor.
 
*** Note: An alternate way of initiating a Search-and-Replace sequence is to begin by
highlighting a piece of text (by using ctrl A and then right-cursor key >) and THEN
typing ctrl R. The highlighted text will then appear as the SEARCH string in the
prompt area at the bottom of the screen, and if you press ENTER then you will see
the REPLACE string (remembered from the last time you did a REPLACE). If you change
the REPLACE string and then press ENTER, then the Search-and-Replace operation will
commence from the line that has the text that you originally highlighted.
 
============================ End of User Guide ==============================
