



         Making ^Q= Find Control Tag Type of Your Choice


               Copyright 1989 by Robert J. Sawyer 

                CompuServe User I.D.:  76702,747




WordStar's ^Q= command finds the next font tag in a file.  With 
DEBUG, you can easily modify WordStar so that ^Q= searches for a 
different type of control tag.  This file explains how.  

WordStar 5.5 files can contain the following types of control 
tags.  Note the hexadecimal number corresponding to the type of 
tag you want to search for:

         Color                         01     
         Font ........................ 02     
         Footnote                      03     
         Endnote ..................... 04     
         Annotation                    05     
         Comment ..................... 06     
         Tab                           09     
         End-of-page ................. 0B     
         Page offset                   0C     
         Paragraph number ............ 0D     
         Index entry                   0E     
         User print control .......... 0F     
         Graphics tag                  10     
         Style sheet tag ............. 11     
         Alternative/normal font       15     


You must have the MS-DOS or PC-DOS program DEBUG.COM available;
it may already be on your hard disk, or it may be on one of your
MS-DOS floppies.
 
Go to your WordStar directory and issue these three commands:
 
  C>COPY WS.EXE WSOLD.EXE
 
  C>REN WS.EXE X
 
  C>DEBUG X
 
You will see DEBUG's prompt, which is a hyphen:
 
  -
 
At the hyphen, type "r", so that your screen looks like this:
 
  -r
 
Hit Enter.  DEBUG will display a screen like this:
 
  AX=0000  BX=0002  CX=CF00  DX=0000  SP=FFEE  BP=0000  SI=0000  DI=0000
  DS=13F7  ES=13F7  SS=13F7  CS=13F7  IP=0100   NV UP EI PL NZ NA PO NC
  13F7:0100 4D            DEC     BP
 
See the phrase "CS=" in the second line?  Jot down the hex number 
after it (in this example, which should be correct for WordStar 
5.5 Rev. C, the number is 13F7; if you're using a different 
version of WordStar, the number may be different).
 
Now, add 1000 hex to that number.  That is, if the number is 
13F7, the number you want is 23F7.  We'll call this new number 
NNNN.
 
DEBUG should be presenting its hyphen prompt again:
 
  -
 
Type this at the hyphen prompt (don't re-type the hyphen),
substituting the actual number for NNNN:
 
  -e NNNN:7e3
 
DEBUG will respond with this (the four digit numbers may be
different):
 
  23F7:07E3  02.
 
(If the number at the right is NOT 02, then you've made a 
mistake.
In that case only, hit Enter to get back to the hyphen prompt, 
and
then type "q" then hit Enter to get out of DEBUG.)  

02 is the symmetrical sequence identification byte for a font 
choice.  Type the hexadecimal number from the list at the 
beginning of this file corresponding to the type of control tag 
you prefer to search for.  For instance, if you want ^Q= to find 
paragraph style tags, simply type 11 after the period.  Your 
screen should now look like this:
 
  23F7:07E3  02.11
 
Hit Enter.  DEBUG will respond with its hyphen prompt again:
 
  -
 
We have to change the symmetrical sequence identification byte at
one other location in WS.EXE.  At the hyphen prompt, type the
following (don't retype the hyphen), remembering to substitute
the real number for NNNN, then press Enter:
 
  -e NNNN:802
 
DEBUG will respond with this (again, the four-digit numbers may
be different):
 
  23F7:0802  02.
 
Once again, type the hexadecimal number that corresponds to the 
type of font tag you want to search for.  Again, if it's 
paragraph style tags, that number is 11.  Once done, type Enter:
 
  23F7:0802  02.11
 
That's the end of our changes.  DEBUG should be showing its
hyphen prompt again.  To write the changes to disk, type "w" and
hit Enter:
 
  -w
 
DEBUG will respond with a message like the one below (the number
may be different, depending on your version of WordStar):
 
   Writing 2CF00 bytes
 
DEBUG should again offer its hyphen prompt.  Type "q" to quit and
hit Enter:
 
  -q
 
You should now be back at the DOS prompt.  Issue this command to
rename the file back to WS.EXE:
 
  C>REN X WS.EXE
 
That's it!  WS.EXE's ^Q= command will now find the command tag 
type you specified instead of font selection tags.  WSOLD.EXE 
will work the old way, with ^Q= finding font choices.




                            # # # # #
