----------------------------------------------------------------------------
|                           Uedit.manual V1.2                              |
|       (Copyright (C) 1986 Rick Stiles.  All rights reserved.)            |
|   Scientific/Business Systems, P.O. Box 566095,  Atlanta, GA 30356-6002  |
----------------------------------------------------------------------------
                             - About Uedit -

Uedit is an  Extremely  Powerful  Text  Editor!   Uedit  is an Utility Editor.
With Uedit, you can edit up to 20 text files at once!   You can be cutting and
pasting,  typing  and  deleting, in a dozen places, and Uedit makes it Natural
and Easy for you!

All 50 buffers have their own colorful hilited and inverted  regions,  cursor,
and  other  attributes,  so that you can be working at separate places in each
file or buffer, without getting lost or confused.

Uedit  has  word  processing  features,  such   as   word-wrap,   auto-indent,
right-justify, over-strike, auto-backup, and many more.  Uedit  has  far  more
text-editing power and flexibility for customizing than word processors do.

The Menus and the Help-key are all you really need  in  order  to  use  Uedit.
You can even customize Uedit while editing, using only the Menus and Help-key!



                    ****   Uedit's Features   ****

       - Edit 20 files at once.
       - 8 megabytes per file.
       - Cut/paste/copy with separate hilited/inverted regions in 50 buffers.
       - Undo accidental deletes.
       - Forward and backward searching and replacing.
       - Wildcard and either/or in search-strings.  
       - 3-keystroke sequence swaps function-keys anytime.
       - Every menu, item, gadget, key, mouse function customizable!
       - Up to 5 menus, up to 20 items each.
       - Save or recover configuration anytime.
       - Program to load files automatically at start-up.
       - Learn 100 inputs - keys, gadgets, mouse-clicks, menu selections.
       - Execute DOS commands.
       - Directory listings.
       - Does not disable multi-tasking as other products do.
       - Print hilited region.
       - Speak hilited region and error messages.
       - Invisible "gadgets" in message line.
       - Auto-indent, auto-backup, word-wrap, right-justify, over-strike etc.



                          - Getting Started -

Before doing anything else, make a BACKUP COPY of your Uedit disk!

In your work volume, you will need:
        Uedit
        Uedit.info (the icon)
        Uedit.help
        Uedit.dat  (or else Uedit.cfg)

To start Uedit in the WorkBench, double-click the Uedit icon.

To  start Uedit in CLI, type "Uedit file1 file2 etc", naming up to 20 files to
edit.



                              The Tutorial

Press the CTRL-key and click the name below with the left mouse button:
                         Uedit.tutorial

Follow the instructions given in the tutorial.   This  will  familiarize  you
with some of what Uedit can do.



                          Four Keys To Remember

HELP key:  Loads in "Uedit.help" the first time it is pressed, and makes it go
           away the second time it is pressed.

Amiga-ESC: Will abort  any process, except for "dangerous" things  like  being
           in the middle of loading or saving a file.

ESC  key:  Terminates  Primitive  Mode  inputs, like when you are typing in  a
           filename or a search-string.

keypad-5:  Finds the cursor and centers it in the window.



                            Primitive Mode

Think  of  Primitive  Mode  as  the world's dumbest editor.  Primitive Mode is
used  for   one-time  things  like  entering  filenames,  search  and  replace
strings, line numbers, and so on.

Here is everything there is to know about Primitive Mode:

   - The Title-Bar always tells you when you are in Primitive Mode.

   - Function-keys, menus, and mouse buttons do not work in Primitive Mode.

   - To delete characters, use BACKSPACE and DEL.

   - To skip forward or backward, use shift-SPACE or shift-BACKSPACE.

   - When finished typing, press ESC.
   


                  Cursor Movement and the Number-Keypad

The cursor can be placed anywhere by putting the mouse-cursor on the desired
spot and clicking the left mouse-button.  The  number-keypad  also  moves  the
cursor,  as  well   as  doing  cut/paste/copy,  scratch  deleting,  Undo,  and
"find cursor".

The number-keypad keys are very logically laid out so that  you  can  remember
them easily:
                           7 8 9
                           4 5 6
                           1 2 3
                            0  .
                           - Enter

   Keys 8 & 2:   move the cursor up and down.
   Keys 4 & 6:   move the cursor left and right.
   Key 5:        "find" the cursor and center it in the screen.
   Keys 7 & 9:   delete left and right.
   Key 0:        "undo" scratch-deletes.
   Keys 1 & 3:   set start and end of Hilite region, respectively.
   Keys   "Dot": copy Hilited region.
        "Minus": cut Hilited region.  (In other words, copy, then delete.)
        "Enter": paste Hilited region at the cursor.

Using shft/alt/ctl keys with the keypad affects two things:

1)  whether cursor movement and "scratch" deletes are at word, character, line
    or page level of "power"; and,

2)  whether the Hilite or the Invert region is used in cut/paste/copy.

The normal keypad operates at "word" level of "power".

Shift-keypad operates at "character" level.

(Some might prefer having "character" level at normal-keypad and "word" level
at shifted keypad.  This can be arranged using "Swap keys", as described in
a following section.)

The Alt-keypad operates at "line" level.

And the Ctl-keypad operates at "page" level.

The normal-, shft- and alt-keypad all use the Hilite region in  cut/paste/copy
operations.   And  keys  1  & 3 set the beginning and end of the Hilite region
(at the cursor, wherever it is.)

The ctl-keypad lets you do cut/paste/copy on the Invert region.   And  on  the
ctl-keypad, keys 1 & 3 set the beginning and ending of the Invert region.

On any keypad level, pressing keypad-5 will "find" the cursor.

And  on  any  keypad level, keys 2, 4, 5, 6, and 8 are always "safe" - because
all they do is move the cursor around.



                         Paging and Scrolling

Paging and scrolling (which do not move the cursor) are controlled by the
arrow keys.

As  with  the  number-keypad keys, the level of "power" is determined by which
shift keys you use with them.

The first two invisible "gadgets" also scroll forward and  backward  by  page.
To  try  these out, click the left mouse button in the first or second quarter
of the message-line just under the Window Title bar.



                    Loading, Saving and Closing Files

These can all be done with the Files menu.  When typing  in  a  filename,  you
are  in  Primitive  Mode  and  must  terminate  your  input  by  pressing ESC.

You  can  save  the file in the window by pressing F2 also.  And F3 will close
the file in the window.

Press the HELP-key to see what the function keys are that you  might  want  to
memorize.

Or just rely on the Files menu.



                          Files and Favorites

To  look  at  the  next  file of up to 20 being edited at once, you can select
"Next file" in the "Files" menu.  But function  keys  are  handier  for  this.
F1 will switch to the next file also.

If  a  number  of  files  are being edited, there may be "favorites".  To mark
files  as  "favorite",  select  "Favorite"  in  the  "Settings" menu when that
particular file is in the window.

To see the "settings" for a  particular  file,  select  "Show  flags"  in  the
Settings menu.

To  switch  among  "favorites",  select  "Next  favorite" in the "Files" menu.
Pressing shift-F1 will also switch to the next "favorite" file.

To  make  a  file  an  "unfavorite",  select "Favorite" in the Settings menu a
second time.


                            Hidden Gadgets

There is a handier way to move among files and "favorites", if you enjoy using
the  mouse.   The  message-line,  just  beneath  the  Title Bar of the window,
contains four invisible "gadgets" which are activated by clicking the mouse in
them.

------------------------------------------------------------------------------
|   Page Backward   |   Page Forward     |   Next Favorite  |  Next File     |
------------------------------------------------------------------------------

The message line is divided into 4 equal horizontal sections.  Clicking in the
appropriate quarter of the message line will do one of:
Page Backward, Page Forward, Next Favorite, and Next File.

Of course, if the "Favorite" setting has  not  been  selected  for  any  file,
nothing will happen when "Next Favorite" is clicked with the mouse.



                   Learn Mode and Command Multiplier

Uedit  can  "learn"  a sequence of up to 100 keystrokes, mouse clicks and menu
selections  and execute them on demand.  Amazingly powerful things can be done
using Learn Mode.  Be sure and read the Customer Mailing List Example  in  the
Appendix to this manual.

To use Learn Mode, do the following:
1) Press ctl-s.  This starts Learn Mode.  Press again to abort learning.
2) Type the desired sequence of letters and function keys etc.
3) Press ctl-r to terminate learning.  Press as many times as desired to run.

Once you've dropped out of Learn Mode by pressing ctl-r, you can press  ctl-m,
to  set  command-multiplier,  and  "multiply" the number of times the next key
pressed will be executed.

If the learn-buffer becomes full, learn-mode will  terminate  by  itself.   It
will let you know.  You may want to do the "learn" sequence over.

Mouse-locations  are  also  "learned"  in  Learn  Mode.   If  you position the
cursor with the mouse during  Learn  Mode,  and  if  your  learn-sequence  may
involve  scrolling  the  text  to another page, then your mouse locations will
probably be meaningless on that new page of text.

If your "learn" sequence will not involve scrolling the display, go ahead
and position the cursor with the mouse during it.

But if the "learn" sequence may involve scrolling, do your cursor-positioning
with the keypad keys.  That way the mouse's location won't be involved.



                           Buffers and Files

Uedit has 55 buffers, altogether. The first 20 are used for storing text files
that you load into Uedit.  These are buffers 0 through 19.

Buffers 20 through 49 are used for storing such things as search/replace text,
cut and paste text, and so on.

Buffers 50 through 54 are used by individual Uedit commands.

You  do  not  need  to  worry  about  buffer  numbers, unless you want to swap
buffers around.

To  see  what  is  in each buffer, select "Show bufs" in the Buffers menu.  To
edit a particular buffer, select "Edit buf" and  type  in  the  buffer  number
followed by ESC.

Saving  memory-space:   It  is good practice to select "Free bufs" in the menu
now and then, when the buffers aren't holding anything vital.   They  will  be
holding  your  last  copied  Hilite  or  Invert,  the  last search and replace
strings, and so on.



                      Setting Uedit's Colors

To set the colors Uedit uses, do this:

1.)  Before bringing up Uedit, adjust the WorkBench colors using  Preferences.

2.)  Start  Uedit,  load  in  a  text file, and create overlapping Hilite and
     Invert regions.

3.)  Press alt-Help until you see a color combination that looks good to  you.

4.)  Select "Save config" in the Commands menu.

Uedit has 24 color combinations, using the 4 WorkBench colors.



                    Printer Control and Control Characters

Escape sequences for printer control can be imbedded directly in the text by
pressing CTRL-c and then typing a control character.  The ESC key works as a
control character the same as CTRL-[.  Inputting control characters does not
require  pressing  the  CTRL-key.   Just  typing  the  letter is all  that's
required.  For example CTRL-c followed by the letter "l" puts in a formfeed.

To identify the numerical value of a "spook"  character,  put  the  cursor on
the  box  character and press CTRL-/.  The Settings menu (or pressing CTRL-v)
lets you make "spook" characters visible or invisible in each file or buffer.



                     Creating Hilite and Invert Regions

A region can be Hilited using three methods:

   1.  Keypad-1 sets the beginning of Hilite at the cursor location.
       Move the cursor and press keypad-3 to set the end of Hilite.

   2.  Move the mouse to where you want beginning of Hilite to be.  Hold down
       the shift-key, and click the left mouse  button.   Move  the  mouse  to
       where  you  want end of Hilite to be.  Hold down the alt-key, and click
       the left button again.

   3.  Hold down the shift, alt, and ctl keys.  Move the mouse  to  where  you
       want  Hilite  to  begin.   Hold  down  the left mouse button.  Move the
       mouse to where you want Hilite to end, and release  the  mouse  button.

Creating an Invert region is much the same:

   1.  Ctl-keypad-1  sets  the  beginning  of  Invert at the cursor location.
       Move the cursor lower in the text and press ctl-keypad-3 to set the end
       of Invert.

   2.  Press ctrl-shift and click the mouse where you want  the  beginning  of
       Invert  to  be.   Press ctrl-alt and click the mouse where you want the
       end of the Invert region to be.



                        Cut, Paste, Copy and Clear

The Edits menu has separate cut/paste/copy/clear  selections  for  Hilite  and
Invert regions.  The first set are for the Hilite region.

Also  there  are  selections  for  unhiliting and uninverting colored regions.

Cut/paste/copy/clear can also be done with the number-keypad, and in  fact  it
is much less bother than using the Edits menu for these.

Keypad-Dot makes a Copy.

Keypad-Minus makes a Cut, which is a Copy followed by a Clear.

Keypad-Enter does a Paste of what was Copied earlier.

Only ctl-keypad works on the Invert region.  All the rest work on  the  Hilite
region.

Ctl-h Clears the Hilite region.  It does not keep a copy of it!

Ctl-i Clears the Invert region.  Again, no copy is made!

Alt-h unhilites the Hilite region.  Alt-i uninverts the Invert region.

Each file or buffer has its own Hilite and Invert regions!



                        Search and Replace

These are listed in the "Buffers" menu.  However, it  is  easier  to  do  them
using function keys.

F7:        Input a search string.
F8:        Input a replace string.
F9:        Search Forward.
Shift-F9:  Search Backward.
F10:       Replace Forward.
Shift-F10: Replace Backward.

When "search" finds what it is looking for, it does three things:
   1) It puts the cursor at the beginning of the "matched" region.
   2) It Inverts the "matched" region, to emphasize it.
   3) It scrolls the display so that the cursor location is center-screen.

Either/or and Wildcards:
Search-strings  can  have an either/or delimiter and wildcards.  The either/or
character is the dollar sign "$".  The wildcard  is  the  question  mark  "?".

Thus,  to  search  for  "Nancy"  OR  "Albert",  your  search  string  would be
"Nancy$Albert".

To search for "Smith" under various spellings, such as  "Smythe",  the  search
string would be "Sm?th".

Multiple  wildcards  "?"  are allowed.  But only one either/or "$" is allowed.

You can change the either/or and wildcard  characters  to  something  else  by
editing  Uedit.cfg  and  causing  it  to  be  recompiled.   How  to do this is
described in the section on Customizing Uedit.

Note:  Search and replace strings can contain carriage returns.  Be sure  that
when you enter a carriage return, you really mean it to be there.

Search strings can be up to 63 characters in length.  If you use an either/or,
then each side of the either/or can be up to 63 characters.   Replace  strings
can be as large as maximum file-size (8 megabytes).



                        Flags and Settings 

In  the  Settings menu are flags and settings affecting either the editor as a
whole or the file currently in the window.

To see the flag settings, select "Show flags" in the menu.

Example:   When  you  press  HELP, Uedit.help is loaded in with its "readOnly"
flag set to True.  If you try to type into it, you'll  get  a  message  saying
that  it's  a  read-only  file.  If you select "Read-only", the switch will be
changed to the "off" position for read-only status.  You can  verify  this  by
selecting "Show flags" again. 

The flag "Busies" refers to the "working ..." messages which  flicker  on  and
off  as  you  edit.    These  messages tell which buffer is being examined and
possibly packed by Uedit.   It is okay to continue typing when a "working ..."
message  is  visible.   To get rid of the messages, select "Busies" again.

If the "Favorite" flag is turned on, the file in the window  can  be  returned
to  quickly,  jumping  over  the  rest, by selecting "Next fav't" in the Files
menu, or by pressing shift-F1, or by clicking the 3rd invisible "gadget".

Each file or buffer has its own settings for these flags.

When a file is loaded, it receives the  default  settings  which  are  in  the
config-file, Uedit.cfg.

"Speak  msgs"  and  "Speak  alerts"  are  global  flags.  They do not apply to
files.

NOTE:  If the AmigaDOS "Say" program is not on your disk, then "speaking" will
not work.  If you have the "Speak msgs" and/or  "Speak  alerts"  flag(s)  set,
there  will  be  an  annoying  pause  each  time the editor tries to "speak" a
message or an alert.

In this event, reset the flags by reselecting them again in the menu. 



                         End-of-line Character

Text files use different end-of-line characters,  depending  upon  where  they
were  originally  created.  Uedit's config-file is preset with the end-of-line
character equal to a linefeed, same as newline.  The ASCII value is 10.

If  you  load  a file whose end-of-line character is not the same one Uedit is
currently using, the file will display ALL ON ONE LINE!  There will be strange
looking box characters where the invalid end-of-line characters are.

In this event, do the following:
1.)  Put the cursor on a box character.
2.)  Press ctl-/.  This will give you the ASCII value of the box character.
3.)  Press ctl-e:
       a) Type in the number from (2) above, followed by ESC.
       b) Type in the current end-of-line value, usually 10.

To change the end-of-line character Uedit uses, press alt-e.



                        Advanced Features

You  can  customize Uedit an amazing amount without reading or knowing a whole
lot.  The following sections tell you:

1.)  how to change Uedit's start-up default settings for right-justify,  auto-
indent etc;

2.)  how to swap and kill keys;

3.)  how to make your own menus and items;

4.)  how to make Uedit load your files automatically at start-up;

5.)  how to create simple commands to auto-insert headers and footers.


For advanced users, the following files are on Uedit's disk:

   Uedit.doc       (technical information)
   Uedit.funcs     (functions to use in making commands)
   Uedit.examples  (examples of commands)

You do not have to read these files in order to  use  the  features  described
below, however.



                       Config-File and Dat-File

Uedit  looks  for Uedit.dat, the dat-file, when you start up.   If  it  cannot
find Uedit.dat, it automatically loads and reads Uedit.cfg,  the  config-file.

Reading  and  compiling  the  config-file  takes  about  twenty seconds.  Then
Uedit asks if you want to make a new dat-file.  If you select  Yes,  then  the
next  time  Uedit  comes  up  it will be able to find Uedit.dat and won't need
the config-file.

If  Uedit  finds a mistake in the config-file while compiling it, it will stop
and show you where the error is.  You will be in Primitive Mode  and  can  fix
the error.

Pressing  ESC  restarts  the  compile  of the config-file.  Pressing shift-ESC
lets you drop out of Uedit without continuing.

If  you  look  at  Uedit.cfg, the config-file, you will see that every command
Uedit uses is defined there.   Even  the  menus  and  menu  items  and gadgets
and  what  the  mouse  buttons  do   -  everything  Uedit can do is defined in
Uedit.cfg.

At the front  of  Uedit.cfg  are  default  settings  which  Uedit  uses.   For
instance,  there  is  the  word-wrap  flag setting.  Uedit automatically loads
files with word-wrap turned ON, because that is what the config-file  says  to
do.   By  changing  the  "<1>"  to  a  "<0>", you can make word-wrap no longer
automatic for files you load into the editor.



                      Changing Uedit's Defaults

If you want to change the default settings used by Uedit, do the following:

1.)  Load Uedit.cfg into the editor.

2.)  Change the default settings in the front of Uedit.cfg as desired.

3.)  Save and close Uedit.cfg.

4.)  Get out of Uedit and return to CLI.

5.)  Rename or delete Uedit.dat.

6.)  Restart  Uedit.   Uedit  will  compile  the  config-file  automatically.
     If  it  finds  a mistake, it will put you into Primitive Mode so that you
     can edit out the mistake and make any other changes  you  want  to  make.

     Press  ESC  to resume compiling the config-file.  Press shift-ESC to quit
     and get out of Uedit, if you want to rename  the  old  dat-file  back  to
     Uedit.dat again so that you can use Uedit like before.

7.)  When  finished  compiling,  Uedit  will  let  you save Uedit.dat and any
     changes you may have made to Uedit.cfg.



                            Customizing Uedit
                               
Looking at Uedit.cfg, you'll see how easy it would be to  make  all  sorts  of
simple  changes  in  Uedit,  even  without  reading  about  Uedit's   Advanced
Features.

For instance, to get rid of a menu item, just delete the appropriate  line  in
Uedit.cfg.   Then  recompile  Uedit.cfg  according  to the simple instructions
given above.

To make a new menu item, just type a line that looks similar to the lines  you
will see in Uedit.cfg.

To  change  a  menu  item's title or a menu header title is even simpler.  The
number inside the menu("title....",number,key) function  is  simply  the  menu
number.   The  very  first  entry with  a  new  number  is  the  Menu   Title.

How could it be simpler?  But we'll describe it in more detail later on.



                     Swapping and Killing Keys

Use these with care!  Swapping and killing keys takes  two  seconds  or  less.
It would be the easiest thing about Uedit except for two things:

1.)  Key commands  sometimes  "borrow"  other  key  commands.   Thus,  if  the
"other"  one  is  swapped or killed, then the one "borrowing" it won't be able
to find it anymore and it won't work properly.

2.)   ALL  menu  items execute key commands.  If you swap those, the menu item
won't be able to find its key to execute.

If you mess things up while swapping and killing keys, select "Load config" in
the  menu  to  recover  the  old  configuration.   If you messed things up and
selected "Save config" and overwrote the Uedit.dat on disk, then you will have
to  recover  Uedit's  configuration  using the Uedit.cfg file or get a copy of
Uedit.dat from another disk.

If  you  are  going  to  be  swapping a lot of keys around, it's easier to use
altCtl-f6  than to select "Swap keys" in the menu.  This key can be swapped to
a more convenient key, of course, such as the ESC key.

Anytime you use a key a lot, it's convenient to swap it to a  favored  key  so
that  Uedit  makes life easy for you like it is supposed to!  (For example, in
writing this manual, ctl-j, the merge-lines key, was swapped to the ESC key.)

When about to swap keys, there are things to be mindful of, as we said:

1.) Key-commands are executed when menu items  are  selected.    If  you  pull
Uedit.cfg  into  the  editor and search on "menu", you'll see that this is so.
If a menu-item's key is swapped, then the next time the menu item is selected,
it  will execute the function of the key it was swapped with.  Uedit will WARN
you and let you back out, if you try to swap a menu  item's  key  by  mistake.

       Example: You  can  swap the "Swap keys"  function  key  altCtl-f6  with
       keypad-kp5 (the unshifted "5" on the number-keypad).   Then  next  time
       you select "Swap keys" in the menu, instead of letting you swap keys it
       will "find" the cursor and center it in the window.   So  you  probably
       won't  want  to swap keys which are used by menu selections.   They can
       always be swapped back, if you can remember what was swapped with what.
       Or  if  you really mess things up, select "Load config" in the menu and
       revert back to the configuration in the dat-file.

2.) If "Swap keys"  or  "Kill  key"  is  selected  by  mistake,  either  press
Amiga-ESC  (the Abort key) or type a couple of "safe" keys, such as the letter
"a".  Do not press the left  mouse  button,  unless  you  know  what  you  are
swapping!  (See Uedit.doc for an explanation of this.)

3.)   Key-commands  may  "borrow"  the  commands  of other keys.  This sharing
allows Uedit's definition to be more compact.  Also it makes  the  config-file
less  cluttered  and  confusing.  You can see many examples of code sharing by
loading Uedit.cfg into the editor and searching on "runKey".

In the HELP file, keys which are executed by other keys, and  hence  shouldn't
be swapped, are marked with a (*).  You can go ahead and swap them anyway, but
you  should  be  aware  of  what  key  calls  what  key,  as you are doing it!

To swap keys which are borrowed by other keys, you  should  really  swap  them
by  editing  Uedit.cfg  and recompiling it. Search for every runKey() function
which borrows the key being  swapped, and change the key inside  the  runKey()
function  to  the  new  key  you are swapping to.  And change the key argument
which is in the key's command definition in Uedit.cfg.

This is far simpler than it sounds:  Suppose the  key you are swapping is  the
search-forward  key,  normal-f9.   This  key is used in a menu item, and it is
"borrowed" by the replace-forward key also, normal-f10.  Suppose you  want  to
swap  it  with normal-esc, the ESC key.  Then in Uedit.cfg, do a simple search
and replace operation.  Search for "normal-f9" and replace with  "normal-esc".
That's  all  there  is to it.  The search replace will change it in all of the
runKey(normal-f9)'s and in  the  menu("Search  fwd",2,normal-f9)  function  as
well.  Then recompile Uedit.cfg, to get the new arrangement.

Another example of key "sharing":

Keypad-Dot is the copy-Hilite key.  The menu item "Copy" also uses keypad-Dot.

Keypad-Minus,  the "Cut"  item  in  the menu, borrows keypad-Dot to "Copy" the
Hilite region, before it "Clears" it.

That's how keypad-Minus does the "Cut", which is a Cut followed by a Clear.

What  happens  if  you  "kill"  a key which a menu item uses or swap it with a
"no function" key so that the menu item's key has no function?  The menu  item
won't  work  anymore.  And if you select "Save config", then the next time you
run Uedit you'll get a menu warning message and the menu item will  no  longer
appear!

                        ***** CRASH WARNINGS *****

Menu   problems should  be  fixed  immediately!  A menu without any items may
crash the Amiga, if you try to use the menu!  See the following section.

There  is  only one other known way you can crash the Amiga with Uedit.  That
one  is  described in Uedit.readme.  If there is a severe shortage of memory,
or if  the  memory  becomes  badly  fragmented,  like  it  does  during  long
search  and  replace  operations,  then if you do something which would bring
up a dialog/alert box or would ask the Amiga to draw one of the  menus,  then
the  Amiga  may  crash  due  to insufficient RAM for the graphics!  The Amiga
should  check   for  available  RAM  and  handle  this  situation  gracefully
somehow, and no doubt it will be fixed by Amiga in the future.

                               **********



                           Making Your Own Menus

It's very easy to make your own menus.

Pull  Uedit.cfg into the editor.  Search for "menu".  You will then be looking
at the "startup" command.  It has a long list of "menu(...)" functions.   Each
menu() function is either a menu header or a menu item.

Menu functions have three arguments:
   menu("description",menu-number,function-key)

To  get  rid  of  a  menu item, simply delete the item in Uedit.cfg.  You will
then need to make Uedit read and compile the modified config-file.   This  was
described earlier.

To  add  new  menu  items,  type  them  in  just  like the ones already in the
config-file.  The function-key must  be  a  valid  one  which  has  a  command
defined  for  it  in  the  config-file.  You can use the Help-file to tell you
what each function key does.

Rules to follow when making your own menus and items:

1)  Menu #s must go in increasing order.  (1-2-3..., not 1-3-2 or 1-3-4.)

2)  Up to 5 menus are allowed, with up to 20 items each.

3)  The first item in each NEW menu# is used as  the  MENU HEADER.   Its  key-
    argument is not used.  But it must be a valid key-name, just the same.
    (See Appendix B for Valid Key Arguments.)

4)  Items following the header, having the same menu  #  as  the  header,  are
    items which will appear in that menu.

5)  Each  key-argument used in a menu item must have a command defined for  it
    in  Uedit.cfg.   Otherwise, Uedit will reject the item when it creates the
    menus.

6)  Each menu header that you define must have at least one valid  item  under
    it!  (See the Crash Warnings above.)

Once you've written your  menu  definitions  and  saved  the  new  version  of
Uedit.cfg to disk, exit from Uedit and do the following:
    - Delete or rename the old Uedit.dat file.
    - Start Uedit again and let it compile the new config file.

WARNING:   If  a Menu Error Message pops up when the new menus are loaded, you
should fix the problem immediately!  Do not select from that  menu  until  you
have  fixed the config-file and caused it to be recompiled using the procedure
described above.

In order to be able to  edit  the  config-file and fix the menu  problem,  you
can rename the old dat-file back to Uedit.dat temporarily.

Menu Error Messages only occur if there is:
    -  a gap in the menu numbers.  (For example, 1-3-4 instead of 1-2-3-4.)
    -  menu items whose commands do not exist,  so  Uedit  must  reject  those
       items.

There are 3 reasons a menu item's command might not exist:
1.  It was not defined in Uedit.cfg to begin with.
2.  It was "killed" using "Kill key".
3.  It was "swapped" with a no-function key using "Swap key".

It  may  seem  like customizing Uedit's menus is tricky and difficult.  But it
is such a logical, simple thing that you should be able to  do  it  right  the
first time, simply by looking at how it is done in Uedit.cfg!



                           Creating Commands

Here  are  a couple of very simple examples of making your  own  new  commands
for Uedit.

Example 1 is:  How to make Uedit auto-load your files upon start-up.

Example 2 is:  How to deal with end-of-line characters.

Example 3 is:  How to auto-insert headers and footers at the press of a key.

Most users don't write big commands for Uedit. There is no need to, when Uedit
has so many features already provided for you.

Another reason why you shouldn't need to write new commands for Uedit  is  the
power available with Learn Mode.  See the example in Appendix A.

If you want to get serious about creating new, powerful commands and features,
you can ctrl-click-load these files for Advanced Users:

                 Uedit.doc    Uedit.funcs    Uedit.examples

Now, on to the Command Examples:



                       Example 1:  Auto-Loading Files

Suppose  you  would  like  for  Uedit to load your files automatically when it
comes up.  Do this:

1) Select "Make Command" in the menu.  Type in a command like  the  one  shown
below, using up to 20 file names:

    <shftAltCtl-z:  loadFile("myfile1")
                    loadFile("myfile2")
                    loadFile("myfile3")
                    speak("Hey, wake up!  I'm ready to go to work!")
    >

Be  sure  to include the left and right angle-brackets to enclose the command.
These show Uedit where it begins and ends.

2)  Now, select "Compile" in the menu, or press F6.

If  you  get  an  error, the cursor will be sitting just past the error point,
so you can edit in the correction.  Then press F6 again.

3)  Once it's compiled, select "Save config" in the menu.

That's it!

You can press shftAltCtl-z anytime and  make  them  load  automatically.   And
Uedit will load them at start-up automatically.

If you don't want the files loaded next time:

1.)  Select "Kill Key" in the menu.

2.)  Very carefully!, press shftAltCtl-z.

3.)  Select "Save  config" in the menu.

If you kill a key by mistake, select "Load config"  to  recover  the  original
Uedit configuration.



               Example 2:  Carriage Returns and Line Feeds

To  change  the  end-of-line  character, use ctl-e and alt-e.  But for certain
printers, you  might need to have both a carriage return and a line feed after
each line.  If so, the following command is assigned to  the  carriage  return
key and inserts both a carriage return and a line feed:

       <normal-return: insertChar(curFile,13)
                       insertChar(curFile,10) >



              Example 3:  Auto-Insertion of Headers and Footers

You can also do these with Learn Mode.  Just press ctl-s, insert the header or
footer  one  time  to  show Uedit how, and then pressing ctl-r will repeat  it
anytime and in any document you are editing.  (See Learn Mode.)

This being the case, there are only two reasons for writing commands  such  as
these.   The  first  is if you need more than one of them available at a time.
Learn Mode can only remember one learned sequence at a time. The second reason
is if you need to save the commands to be make them available permanently.

If documents frequently need a certain heading or a certain ending, it can  be
inserted automatically by pressing a key:

First,  edit  and  save  to  disk the files which have your standard header or
footer or whatever text you wish to insert automatically.

Pick one or more of these examples to use.  In  the  examples,  "sFile"  means
start-of-file,  "eFile"  means  end-of-file,  "atCursor"  means  what it says.
These tell the function where to insert your header  or  footer  or  whatever.
"curFile" means insert it into the current file in Uedit's window:

1.)  This one loads your header file and inserts it at the Start of your  text
file:

       <altCtl-h: insertFile(curFile,sFile,"MyHeaderFile")>

Press F6 to compile it, just as in the above example.  Select  "Save  config",
if you want it to be available the next time you use Uedit.

2.) This one loads your footer text and inserts it at the End of your text
file:

       <altCtl-f: insertFile(curFile,sFile,"MyFooterFile")>

3.)  This one loads your "middle" text and inserts it at the cursor,  wherever
it may be:

   <altCtl-m: insertFile(curFile,atCursor,"MyMiddleFile")>

4.)  There's another way to do these.  If the header is just a few lines long,
you can store it inside the command itself:

    <altCtl-h:  insertRgn(curFile,sFile,"Dear Sir, etc etc etc
         blah-blah-blah
         carriage returns,
         indents, and everything else",all)>

If you use "eFile" instead of "sFile", it could insert a letter ending at  the
end  of  your document.  And if "atCursor" is used, it could insert a piece of
text at the cursor location, wherever it is.

Compile  these examples as described previously.  To make Uedit be able to use
them next time, select "Save config" in the menu.

You could also type these examples into Uedit.cfg and make menu selections for
them very easily.  Then follow the simple 2-step procedure for bringing up the
customized config-file as described earlier.

If you plan to write simple commands like these, you should look at Appendix B
which describes Valid Key Arguments.  That way you'll know how to attach  them
to any key on the Amiga's keyboard.  But you'll get the gist of what valid key
arguments look like, if you just take a look at Uedit.cfg, which  defines  all
of Uedit's commands.



                   APPENDIX A.  A Learn Mode Example


         Automatic Insertion of Customer Names from a Mailing List

Suppose  that  you  have  a form letter you wish to send to each customer on a
mailing list.  You need to merge the names into the form  letter  one  by  one
and print the form letter.

This example actually arose when an Amiga  dealer  asked  if  Uedit  could  do
something like this.  For Uedit, it's a piece of cake!

If  this example looks complicated, you would not think so at all, if you were
doing it yourself, familiar with Uedit's  keys  and  menus.   The  Learn  Mode
simply  "learns"  what  you do.  Show Uedit how to do a process just one time,
and it can repeat it over and over.

Learn Mode is ideal for this example.

Getting ready:

1.)   Load  the  customer list and form letter into Uedit.  If other files are
also in Uedit, make the customer list and form letter "favorite" files.

2.)   Hilite the entire form letter.  Make sure that it is  the  right  length
for  the  printer's  paper  or press ctl-c and then ctl-l to put in a formfeed
character at the top or bottom of the form letter.

3.)   Put the cursor where the customer's name goes into the form letter.
Type  the  word  "Dear ,", including the space and the comma.  Put the cursor
right on top of the comma!

4.) Select "Next file" or "Next fav't" to switch to the customer list  file.

The cursor should  be sitting at the start of the customer list.  If there are
blank lines at the top of the list, put the cursor at  the  beginning  of  the
line which has the first customer name.

Suppose the customer list looks like this:

       John Doe cust####
       address1
       address2
                           blank line
       Mary Smith cust### etc.

And  you  want  to  put "Dear John,", "Dear Mary,", etc into the form letters.
The cursor starts out at the beginning of the John Doe line.

Now the Learn Mode sequence:

1.)   Press ctl-s to start Learn Mode.  (Press ctl-s again to  abort,  if  you
need to start over.)

2.)   Press  normal-kp6,  the  6  on the number-keypad.  This moves the cursor
to the right of the word "John".

3.)   Press normal-kp7, which deletes the word "John".

4.)   Press normal-kp0, the 0 on the keypad, which  is  the  Undo  key.   This
step isn't necessary, if you don't care whether "John" is put back or not.

5.)  Select "Next file" or "Next fav't" in the menu to switch to form letter.

6.)  Press normal-kp0, the Undo key, putting "John" into the letter.

7.)  Press ctl-p, which sends the hilite region to the printer.

8.)  Press normal-kp7, deleting the word "John" from the form letter.

9.)  Select "Next file" or "Next fav't" to switch to the customer list.

10.)  Press  normal-kp2  FOUR  times, which  moves  the  cursor  down  to  the
line of the next customer name.

End of Learn Mode sequence:

1.)   Press ctl-r to stop learning.  Press again to run, if you wish.

2.)   Press  ctl-m  to set the command multiplier  for the number of customers
on the list.  Then press ctl-r and watch them print.

To  abort  anytime, press Amiga-esc.  To restart, it's not necessary to do the
learn sequence over, unless you made a mistake in it.

Obviously,  if  you  want  to  "cut  and  paste"  the  entire name and address
blocks, it is even easier than this example.  ctl-d will delete the lines  and
Undo will drop them into the letter.



                     APPENDIX B.  Valid Key Arguments

Every key on the keyboard can be used for  function  keys,  except  the  Amiga
keys.   They  were left out only because it seemed like about 800 possible key
combinations were plenty.  Even the letter "a" and the space-bar can  be  used
as function keys.  Also  included  here  are  the  invisible  gadgets  in  the
message line.  Thus, you can have approximately 800 commands defined for Uedit
all at the same time.

Key prefixes (or modifiers) are:

normal- shft- alt- ctl- shftAlt- shftCtl- altCtl- and shftAltCtl-

Only the "startup:" command does not use a prefix.  Every other key requires a
prefix.

The prefix is followed by any printable key, such as "z" or  ".",  or  by  any
non-printable key such as a function key. (Use only lower case printable keys.
See examples below.)

  The non-printable keys are:
         esc tab f1 f2 f3 f4 f5 f6 f7 f8 f9 f10
         del bs (for backspace) help return space
         upArrow downArrow leftArrow rightArrow
         kpMinus kpEnter kpDot             ("kp" is for "keypad")
         kp1 kp2 kp3 kp4 kp5 kp6 kp7 kp8 kp9 kp0
         buttonDown buttonUp               (Left mouse-button.)
         gadget1 gadget2 gadget3 gadget4   (The hidden gadgets are in the
                                            line just below the Title Bar.)
         Examples of key arguments are:
         shftAlt-f1:
         altCtl-upArrow:
         ctl-/:
         alt-kpDot:         ("kp" refers to keypad)
         normal-buttonDown: (Left mouse-button.  Right button is for menus.)
         ctl-gadget3:       (Each "gadget" is 1/4 of the message line.)
         shft-7:            (The "7" is not the one on the keypad.   That  one
                             would be "kp7".)
         startup:           ("startup:" isn't allowed a prefix.)
         altCtl-esc:
         shftAlt-help:
         normal-del:
         normal-z:         (Who'd want to use a printable key like "z" for
                            a function key?)


   Examples of Incorrect key arguments are:
         normal-$:     (correctly, it would be shft-4:)
         normal-P:     (correctly, it would be shft-p:)
         ALT-ESC:      (correctly, it would be alt-esc:)
         shft-startup: ("startup" can't have a prefix)
         Amiga-f4      (the Amiga keys aren't used as prefixes)

