                            DELMACRO
                       Manage your macros

             Copyright 1992, 1993 by John G. Bennett

DELMACRO is a program which provides mass deletion and 
uninstallation of WordStar 7.0 macros, and also for changing 
hotkeys; in many cases it can be used to fix WSHOTKEY.OVR files 
which have been damaged by inadequate Hotkey Buffer size.  It can 
probably be easily used without reading this documentation, 
provided you first run it without any parameters and read the 
resulting usage message, but please observe the following 
warnings:

WARNING: Do not run DELMACRO from within WordStar.  Exit WordStar 
and run DELMACRO from the command line.

WARNING: DELMACRO needs to be told on the command line which 
directory holds the WSHOTKEY.OVR file, and which directory holds 
the *.WSM files.  DO NOT use the DOS .. notation, (e.g., ..\WS) 
as this will confuse DELMACRO's parser.  Spell out all directory 
names you need in full.

WARNING: Always back up vital files (e.g., WSHOTKEY.OVR and your 
MACRO directory) before using DELMACRO.  Accidents happen and the 
program may possibly contain bugs of which the author is unaware.

WARNING: Do not use the /K command line switch unless your BIOS 
supports the calls for the enhanced keyboard (with F11 and F12 
keys).  See further below.

WHAT DELMACRO DOES: DELMACRO presents the user with a list of 
macros rather like the list found in WS 7.0.  The list can be 
navigated with cursor keys and the user may mark macros for 
deletion or uninstallation, and hotkeys assigned may be changed.  
When a macro is uninstalled, its hotkey is freed and it no longer 
can be invoked by hotkey.  When a macro is deleted, it is 
uninstalled, and the .WSM file containing it is deleted from the 
macro directory.  When a file has been uninstalled, it cannot be 
invoked by a hotkey, but it can be run using the Play Macro 
command in WordStar.  When a macro is deleted it is completely 
gone.  When the user has finished marking files on the menu, F10 
begins the process of revising the hotkey assignments and 
deleting the macros marked.

RUNNING DELMACRO: To run DELMACRO you must issue the following 
command at the DOS command line:

     DELMACRO   hotkeypath  macropath

where hotkeypath contains the drive and directory in which you 
WSHOTKEY.OVR file is located (this file is normally in the same 
directory as WS.EXE).  DELMACRO assumes that your hotkey overlay 
file is named "WSHOTKEY.OVR", but if you have renamed it in 
WSCHANGE, include the full file name with drive and directory.  
Similarly, macropath is the drive and directory in which your 
macro files (*.WSM) reside.  Do not use the abbreviation .. in 
your paths; it will confuse DELMACRO's parsing routines.  You 
must include a directory or drive for the hotkey overlay file, 
even if DELMACRO is being run from the directory in which that 
file resides.  The macropath need not be included if you are not 
using the /K switch, but if you do not include it you will not be 
able to delete any macros.  

THE ENHANCED KEYBOARD: When DELMACRO assigns a new hotkey to a 
macro, you must press the new hotkey so DELMACRO knows which one 
you want to assign.  If you have an enhanced keyboard with the 
F11 and F12 keys on it, and if your BIOS can interpret these 
keys, and if you have WS set up for an enhanced keyboard, then 
you can assign F11 and F2 (and their ALT, SHIFT and CTRL 
combinations) to macros as hotkeys.  In order for DELMACRO to be 
able to read these keys, you must use the /K switch when you 
invoke DELMACRO from the command line.  The /K switch must be the 
last item on the command line, following the two directories.  If 
you use the /K swit you must include the macropath in the command 
line, as in this example:

     DELMACRO C:\WS C:\WS\MACROS /K

The /K switch should not be invoked if your BIOS does not support 
the enhanced keyboard.  If it is used on a machine that does not 
support the enhanced keyboard, then the result of trying to enter 
a hotkey in DELMACRO is unpredictable, but in a worst case could 
involve a crash requiring a hard reset.  If you are unsure 
whether your BIOS supports the enhanced keyboard, go into 
WordStar and try to assign a macro the F11 key as hotkey, and 
then try to run the macro by pressing the F11 key.  If this 
works, your machine supports the enhanced keyboard.  If it 
doesn't, then even if your machine supports the enhanced 
keyboard, you are not set up to use the enhanced keyboard, and 
you need not use the switch with DELMACRO.

ACTIONS:  Providing DELMACRO can find your files, it will put a 
alphabetized menu of macros on the screen.  You navigate this 
menu with the cursor (arrow) keys (^D, ^E, ^S, an ^X are 
alternatives), the Home and End keys (which go to the beginning 
and end of the list, respectively) and the Page Up and Page Down 
keys, which move to a new page if the menu covers more than one 
page.  At the lover right of the screen is "Page n of m" 
indicating which page is on screen and how many pages there are.  
To mark a macro for deletion, press D when the menu bar is on the 
macro in question.  To mark a macro for uninstallation, press U 
while the menu bar is on the macro.  To cancel a D or U, press 
the space bar when the menu bar is on the macro.  If the macro's 
hotkey has been reassigned when you press the space bar, you will 
be asked if you wish to restore the hotkey.  Pressing Y restores 
it; pressing any other key cancels the operation.  If you try to 
Delete when DELMACRO couldn't find your macros, nothing will 
happen.

DESCRIPTIONS:  To change the hotkey of a macro, or to assign a 
hotkey to a macro to which no hotkey is assigned, press N.  The 
prompt in the lower left corner of the screen will invite you to 
press the new hotkey.  Do so.  If the hotkey is not already 
assigned, it will be assigned to the macro.  If it is already 
assigned to another macro, the prompt will display the name of 
that macro and ask if you want to reassign the hotkey.  Press Y 
if you want to do so.  Pressing any other key cancels the 
operation.  If you wish to uninstall the hotkey you have just 
assigned, you can do so by pressing U.

LEGAL HOTKEYS: DELMACRO has no way of knowing how you have set up 
WordStar, so it counts as legal any hotkey that might be legal 
under any customization of WordStar.  In particular, it will not 
flag attempts to use the hotkeys which call the pull down menus 
at help level 4, and it will permit you to assign F1 and F10 to 
macros regardless of whether you have set up WordStar to use 
these as hotkeys.  If you assign to macros hotkeys which call 
pull down menus, you will no longer be able to invoke the 
pulldowns with those hotkeys.  If you assign F1 and F10 to macros 
when you have not set up WS to use these as macro hotkeys, they 
will not invoke macros when you press them but will continue to 
have their usual functions.

Pressing F1 puts a description of the macro highlighted by the 
menu bar in the lower left corner of the screen, if the macro has 
a description.  This is the description which is shown in the 
dialogue boxes which you reach from the macro command in 
WordStar.  If you did not give the macro a description when you 
created it, you will not be able to display a description in 
DELMACRO.  If for any reason DELMACRO cannot find the macro file, 
it will write the message "Can't find that macro" in the lower 
left corner of the screen instead; the description is stored in 
the .WSM file, so if DELMACRO can't find that file, it can't 
display the description.

PROCESSING YOUR CHOICES:  When you are through marking macros, 
F10 (or ^K) leaves the macro screen and begins processing your 
selections.  (If you prefer, you may press Escape and leave 
DELMACRO without any action being taken.)  DELMACRO first writes 
a new WSHOTKEY.OVR file and renames the original file to 
WSHOTKEY.BAK.  (If a WSHOTKEY.BAK file already exists, it is 
deleted.)  Then it attempts to delete any macros you have marked 
for deletion.  

DELMACRO sends to the standard output a list of the macros and 
the actions it has taken.  You can redirect this list to a file 
by using DOS redirection when you invoke DELMACRO, for instance:

     DELMACRO C:\WS C:\WS\MACROS >MACRO.LST

In this case, DELMACRO will put the list of macros and actions 
into a file named MACRO.LST in the currently logged directory.

You can use this feature to get a list of all your macros, or of 
just the macros with hotkeys assigned.  Start DELMACRO with the 
redirection as above, and then press F10 to finish without making 
any changes.  If you want a list of only those macros to which 
hotkeys are assigned, give DELMACRO the wrong directory for the 
MACROS; it will then show only those for which hotkeys are 
assigned.  You can edit the file DELMACRO produces with WordStar 
to make a reference card of your hotkeys.

FIXING WSHOTKEY.OVR FILES: WordStar 7.0A was distributed with the 
size of the macro hotkey buffer set to 4.  (This size is set in 
WSCHANGE at CCG.)  Any value less than 7 for this setting can 
cause the hotkey overlay file to become corrupted if the user 
tries to assign more hotkeys than will fit in the buffer.  (WSI 
Tech Support recommends a setting of 8.)  Symptoms of this 
problem include hotkeys not "sticking:" one assigns a hotkey to a 
macro and finds subsequently that the macro is no longer assigned 
a hotkey.  DELMACRO may be able to fix these files.  Run 
DELMACRO.  There may be macro names which appear truncated, 
damaged, or just like garbage, or which are repeated, have spaces 
in them or contain other characters which are illegal is a DOS 
filename.  If so, mark all such garbage names for uninstallation. 
Whether you marked files or not, press F10 to start processing.  
DELMACRO will create a new WSHOTKEY .OVR file which may work.  BE 
SURE TO SET THE HOTKEY BUFFER SIZE TO 8 BEFORE USING WORDSTAR 
AGAIN or the new file may be corrupted also.

ERROR MESSAGES: DELMACRO can issue a variety of error messages 
when things go wrong.  The following are error messages which 
DELMACRO issues when it cannot continue working.  In each case, 
DELMACRO exits setting the DOS error level to a non-zero value.  
The values are given in parentheses after the error messages:

"Couldn't find hotkey file [filename]" (2): DELMACRO couldn't 
find the hotkey overlay file.  Probably the directory given on 
the command line is incorrect.  Enter the full directory with 
drive and path.  If the hotkey overlay file has been renamed, 
include the file name. 

"Couldn't open hotkey file [filename]" (5):  DELMACRO couldn't 
open the hotkey file for reading when it tried to update the 
file.  You should not see this error.

"Couldn't open temporary file for hotkeys." (6): DELMACRO tries 
to open a temporary file, "HOTKEY$$.$$$" while it is updating the 
hotkeys.  If this file already exists, this attempt will fail.  
You will have to delete or rename the offending file and rerun 
DELMACRO.

"Couldn't position properly" (3): You should not see this error.  
In reading the WSHOTKEY.OVR file, a mistake occurred as DELMACRO 
tried to position itself in the file.  Try running DELMACRO 
again.  If the file has been truncated to less than 128 bytes, 
DELMACRO can't handle it; you will need to reinstall the file 
from you distribution disks.

"Error renaming hotkey file." (7):  DELMACRO's attempt to rename 
the hotkey file to a BAK file failed.  

"Error renaming temporary hotkey file." (8):  DELMACRO  couldn't 
rename the temporary file, HOTKEY$$.$$$.  You will have to rename 
it by hand.

[No message] (4): If the user selects Escape to exit DELMACRO 
without making changes, the DOS error level is set to 4.

[Usage message] (1): If DELMACRO is run with no parameters, it 
issues a message summarizing its usage.



DISTRIBUTION: DELMACRO may be freely distributed, subject to the 
following limitations:

     1   It may be distributed only in unaltered form, and with 
          both files, DELMACRO.EXE and DELMACRO.DOC together.

     2   Unless the author, John G. Bennett, gives permission in 
          writing, it may not be sold or distributed as part of a 
          package which is sold.

     3   The program and documentation are distributed as is, 
          with no promise or warranty that they will perform as 
          described or in any other way.  I have tried to make 
          the program and documentation accurate and free of bugs 
          and errors, but probably some remain.  Anyone using 
          this program does so at his or her sole risk, and while 
          the author will attempt to correct errors, 
          inaccuracies, or bugs of which he is notified, he will 
          not be responsible for any errors, omissions, or for 
          any damages resulting from the use of this program.

DELMACRO was written by John G. Bennett, 301 Roslyn St., 
Rochester, NY 14619-1813, CompuServe ID: 72431,1407

WordStar is a trade mark of WordStar International.  DELMACRO is 
not a product of WordStar International, and John G. Bennett is 
not an employee of WordStar International.
