;
                                   ADIR.COM                                   

             Size (recs) CRC   Version    Author/Latest Issue      Disk
ADIR26.COM     5k (35)   50A4  2.6        Greg Miner 9/89          Z3COM1
ADIR25IN.COM   5k (34)   F088  2.5        Greg Miner 8/89          Z3COM1

   1- Syntax  2- Notes  3- Patch Table  4- Error Messages                     

   ADIR provides  a sorted list in a directory format of all Aliases contained
in the ALIAS.CMD file.   ALIAS.CMD must be located in the ROOT directory,  the
last element along your search path.   Alternatively,  ADIR may  be configured 
to search a default directory.   If the  wheel byte is set,  the  directory to
search in the form of DU: or DIR:, may be entered on the command line.

   ADIR.COM is for use with an External Environment.   If using  ZCPR3.3,  you
may use the program  as is.   For ZCPR3.0,  simply patch the  address  of your
External Environment at locations 0109h and 010Ah or use Z3INS.
   ADIRIN.COM is for systems which do not support an external environment.
:1

     Syntax:   ADIR [dir:][filename.ext] [=mask] [/oo]   

    Options:   N   <-- No page pause
               S   <-- Display hidden
               P   <-- Send output to LST:
               Ln  <-- Specify Alias Name length
               Rn  <-- Loads alias count into ZCPR register n (1-9)

   All tokens are optional.  Any invalid or restricted token is ignored.

   When ALIAS.CMD,  or the selected file,  is located in  a password-protected
directory,  either by  path  search or  by user selection,  the Wheel  byte is 
checked  and,  if not set,  the user is requested  for the directory password.
An invalid entry terminates the program. 

   mask:  Takes the form '=mask' and may be up to twenty chars in length.  The
first n chars of each entry are compared to the  mask and the entry eliminated
from the display if no match occurs.
:2
 ADIR Notes - 1/5 

   a. ADIR assumes that the ALIAS.CMD file adheres to a few simple rules:

      1.  ADIR ignores any line beginning with a space or semi-colon.  Aliases
          beginning with  a  punctuation character  are  special  cases.   The 
          leading character is normally ignored and the alias is  displayed as
          though it did not exist.

              Thus the line:
                             :default Z3ERROR
              is ignored, while
                             :DEFAULT Z3ERROR
              would be displayed as:
                              DEFAULT

          If the  /S switch were used in the above example,  then both aliases
           would be displayed as found, including the leading colons.
 ADIR Notes - 2/5 

      2.  ADIR assumes that any alias beginning with a lower case letter (a-z)
          is "system" or hidden.   These are not displayed nor included in the 
          final tally (see switch /S). Thus the lines:

             PACK ROOT:;PUBLIC /CA;PACK2;PUBLIC /DAU8;%D0%U0:
             pACK2 LX SAP;LX PACK10

          produce only one entry,  "PACK" in the  directory.   The rest of the
          alias name may be in  either upper or lower  case, although,  if the
          CAPSON flag is  left  off and hidden  aliases appear in ALIAS.CMD in 
          lower case characters,  they become  easily distinguishable  in  the
          directory when the /S switch is used.  Hidden aliases may also occur
          in either upper or lower case, or in numeric or other form following
          a special comment line which  takes  the form:  ;PRIVATE.   The word
          PRIVATE must occur in upper  case.   No entries following  this line 
          are displayed unless the /S switch is present on the command line. 
 ADIR Notes - 3/5 

      3.  "Equated" aliases are treated as separate entries. 

          ie.  SD=?DIR=D=dIR/? produces two entries: SD and D, while
          ?DIR and dIR/? are ignored as explained above.

      4.  Finally, ADIR assumes by default that the maximum length of an alias
          name will be nine  characters.   This may be altered by changing the
          value of ALENTH as explained above.   Any alias  name which  exceeds
          the value of ALENTH  is truncated and appended with  a semi-colon to
          indicate that it has been truncated. 
 ADIR Notes - 4/5 

   b. Version 2.3 updates:
      - removes code which  prevented  any alias  beginning with a punctuation 
      character being displayed in the non-hidden format.   This code also had 
      the side effect of hiding aliases beginning with numeric characters.   
      - recognizes any character with  the  exception  of ":" and "_"  in  the 
      first character position.   
      - bug is  also fixed which caused ADIR to  hang up if the ALIAS.CMD file  
      happened to end with a blank line, CR or LF as the last character in the
      file.     

   c. Version 2.4 updates:
      - corrects a recursion problem in version 2.3 if any of the options were
      used in previous runs.    All flags are not  reset each time the program 
      is re-entered.
 ADIR Notes - 5/5 

   d. Version 2.5 updates:
      - adds 'truncation' of alias  names which are longer than ALENTH.   Long 
      aliases are presented terminated  with  a  semi-colon.   The  truncation 
      character is patchable at the label TRNCHR.
      - adds test for commented lines (beginning in ";").
      - adds /Ln switch for length specification from the command line.

   e. Version 2.6 updates:
      - terminal data now taken from TCAP if available.  If no TCAP is 
      installed, the values at TLINE and PLINE are used. 
      - in addition to 'lower case' hidden aliases, any alias present after the
      comment line ';PRIVATE' is treated as hidden
      - alias count may be directed to one of the ZCPR registers (1-9)
      - accepts search mask from command line
      - optional default DU to find ALIAS.CMD if non-wheel
      - accepts filename from command line regardless of wheel state
      - internal environment no longer supported
:3
 ADIR Patch Table (configure to suit) - 1/3 

                            Location
LABEL     Function    Default   ADIR22EX  ADIR22IN    Comments
 -------------------------------------------------------------
CAPSON   Capitalize      0       10BH      202H        Note 1
TLINE    Chars/Line   50H/80     10CH      203H        Note 2,3
PLINE    Lines/Page   16H/24     10DH      204H        Note 2
ALENTH   Default Len. 0AH/10     10EH      205H        Note 3
TRNCHR   Trunc. char    ";"                            Note 4 
DEFDU    Default DU   01/00                            Note 5

NOTE 1
   Capitalization Flag.   Default is OFF to display Aliases as found.   If set
TRUE (0FFH),  all  aliases,  including hidden  if  the /S switch  is used, are 
displayed in Upper Case.

NOTE 2
   Terminal characters  per line  and lines per page.   Congigure to suit your 
hardware, or preference (See Note 3).
 ADIR Patch Table - 2/3 

NOTE 3
   Set ALENTH to the  maximum number of characters in  an alias name.   If any 
alias exceeds this length, you'll have trouble.  The number of aliases printed
on  a line is  a function of ALENTH and TLINE.   With the default settings the 
display is  eight columns wide.   The formula for the number of columns is the  
integer of TLINE divided by ALENTH.  Thus if you want a display of six columns
on  an  eighty character terminal,  set TLINE to 50H  and ALENTH to 0DH.   The 
display would then be left justified with 13 chars allotted to each entry.
 
   As a footnote, it should be remembered that the larger ALENTH is, the fewer
actual records ADIR will be able to handle.   This will not  be  a problem  in 
most cases  as ADIR uses all  of available memory for the data table up to the 
location of the CCP.  This means that with the default setting ALENTH=10, over 
4400 Aliases could be accomodated.  

NOTE 4
   This is  the truncation character.   The semi-colon was chosen as it is the
single character which is least likely to appear in  a command name, being the
command separator character on most systems.
 ADIR Patch Table - 3/3 

NOTE 5
   DEFDU provides an alternate method of determining the default directory for
non-wheel users.   If the first byte is  set to FF hex,  then  the normal ROOT 
search method isused.   Otherwise, and  as the default, the default DU  may be
specified.   Byte 1 represents the drive, where A=1; and byte 2 the user area,
0-31.   The ROOT search method is always used if the wheel byte is set and may 
be overridden from the command line.
:4
 Error Messages   

   "du:ALIAS.CMD not found."                                

   - ADIR was unable to locate the file ALIAS.CMD in either the root directory
     by default, or in the specified directory by user selection.

   "File too large. ABORTING"

   - ALIAS.CMD contains more  alias  names  than can  be  accommodated  in the
     available TPA.

   "Can't Sort. File too large"

   - ADIR ran out of buffer space while attempting to sort the list.
