ADIR v2.2 26/01/89 ==================== ADIR provides a sorted list in a directory format of all Aliases contained in the ALIAS.CMD file. ADIR is designed to search for ALIAS.CMD in the ROOT directory, the last element along the search path. Alternatively, the program may be config- ured to search a default directory. If the wheel byte is set, the directory to search in the form DU: or DIR:, may be entered on the command line. Program Usage: ADIR [DIR:][filename.ext] [=mask] [/ooo] All tokens are optional. Any invalid or restricted token is ig- nored. 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. ADIR supports the following command line switches. P - Output is directed to the LST: device as well as to the console. Wheel must be on for this switch to be recognised. S - Hidden aliases are displayed as well. The term "hidden" is explained below. Wheel must be on. N - Output is not paged. No [more] prompts appear when the screen fills. ADIR is configured for an 80 x 24 terminal. See the patch table at the end of this file for configur- ation information. Ln - Where 'n' is numeric. Specify Alias Name length. Used to display alias names which are longer than the default. See NOTE 3 below. Rn - Loads ZCPR register 'n' with the number of matching en- tries. n may be register 1 through 9. mask: Takes the form '=MASK' and may be up to twenty characters in length. The first n characters of each entry are com- pared to the mask and the entry eliminated from the dis- play if no match occurs. ALIAS.CMD file conventions ========================== 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 either a colon or an underline character are special cases. The leading character is normally ignored and the alias is displayed as though the character 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. 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 occcur 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. 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 below. Any alias name which exceeds the vaule of ALENTH is truncated and appended with a semi-colon to indicate that it has been truncated. 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 accomodated in the available TPA. Can't Sort. File too large - ADIR ran out of buffer space while attempting to sort the list. PATCH TABLE - configure to suit =========== Configuration flags are located near the beginning of the code and are easily identified as shown in the label column below. LABEL Function Default Comments --------------------------------------- CAPSON> Capitalize 0 Note 1 TLINE> Chars/Line 50H/80 Note 2,3 PLINE> Lines/Page 16H/24 Note 2 ALENTH> Default Len. 0AH/10 Note 3 TRNCHR> Truncation ';' Note 4 Character 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 Values for terminal width and page length from the TCAP are nor- mally used. In the absence of a TCAP, TLINE and PLINE determine the display format. Congigure to suit your hardware, or preference (See Note 3). NOTE 3 Set ALENTH to the maximum number of characters in an alias name. The number of aliases printed on a line is a function of ALENTH and TLINE. With the default settings the display is eight columes wide. The formula for the number of columes is the integer of TLINE divided by ALENTH. Thus if you want a display of six columes on an eighty character terminal, set TLINE to 50H and ALENTH to 0DH. The display would then be left justified with 13 characters allotted to each entry. It should be remembered that the larger the value of ALENTH, the fewer actual records ADIR will be able to handle. This will not be a problem in most cases as ADIR will use as much of the available memory as it requires for the data table. With the default setting ALENTH=10, over 4400 Aliases could be accomodated. NOTE 4 This is the truncation indicator. 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 sys- tems. 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 is used. 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 over- ridden from the command line. FINAL NOTES =========== I have found ADIR useful for other applications as well. For ex- ample: I keep a list of files with descriptions contained on arc- hived disks. The records of the file take the form: FILENAME.EXT [TYPE] Description. Using an alias: OFFLINE ADIR BLAKBORD.FOR /L15 I am able to quickly obtain a directory of all files I have on backup disks. The same type of file and alias helps me quickly determine whether a particular file may be obtained from other boards by searching captured directory listings. I'd like to hear of other applications. I may be reached at the address or numbers below. Address Comments and/or complaints to: Greg C. Miner Box 232 Port Williams, N.S. Canada B0P 1T0 BBS: ZNODE #11 The BlackBoard (902)-542-5284 G. Miner (Sysop)