& TO.COM v4.3-1	Author: Alan E. Feldman     A This is a SET DEFAULT program for use on Files-11 ODS-2 disks. It D offers much more functionality than the DCL command SET DEFAULT doesC and fixes some of its bugs. It has features that save the user much E typing. I haven't tried it on ODS-5 disks so I don't know how well it  would work on such disks.   	 CONTENTS:    CONVENTION   INSTALLATION  
 QUICK START    FORMAT  
 DESCRIPTION        LOGICAL-NAME RECALL STACK    PARAMETERS       PRECEDENCE  #     TWO-STEP NEW-DEFAULT FUNCTION    USER SETTINGS   
 FEEDBACK       *** CONVENTION ***    C The word 'default' is used in the sense of a device together with a  directory.       *** INSTALLATION ***    D Copy TO.COM to your system and add the following to your LOGIN.COM:    $ TO :== @disk:[dir]TO.COM  D $ TO "/INIT"  ! to initialize TO.COM (this will define the LNM HERE)  C Ensure that both commands above have been run before using TO.COM.       *** QUICK START ***   A Use TO.COM as you would the SET DEFAULT command. After installing  TO.COM, run        $ TO ?    A to get the 23-line quick-help page. This page summarizes the most  important aspects of TO.COM.       *** FORMAT ***    :     $ TO  [new-default] [save-old-def] [DCL-verification]   4 Use "" as a placeholder for any skipped parameters.      *** DESCRIPTION ***   E When you run TO.COM it processes the old and new defaults and reports F any problems that it finds and performs appropriate actions. If all is@ well, it will then set default to the new default; otherwise, anC appropriate error message is displayed. If the new default is good, F TO.COM checks if it matches an entry in the logical-name recall stack.A If it does, it reports the entry number of the first match found. C TO.COM then updates the logical-name recall stack, displays it, and @ displays your current default. Finally, if there was an error inF updating the logical-name recall stack and/or your new-default was not3 set, TO.COM will let you know just before exiting.    < If you run TO.COM without any arguments, it will display theD logical-name recall stack and prompt you for a new default. (See the< section called LOGICAL-NAME RECALL STACK for more details.)   - TO.COM is designed for interactive use only.    C TO.COM should do something reasonable with whatever you give it. If F you find that not to be the case, please send the author a bug report.    " *** LOGICAL-NAME RECALL STACK ***   C Whenever you set default to a new default with TO.COM, it saves the D old default in slot 1 of the recall stack, assigns it to the logicalF name LAST, bumps the other stack entries up one level, and assigns theB new default to the logical name HERE. By default, the logical-name@ recall stack holds up to nine previous defaults plus the current	 default.    8 Stack entries are assigned the following logical names:    	HERE  - current default 	LAST  - last default  	2BACK - 2 defaults back 	3BACK - 3 defaults back 	etc., up to 9BACK  C (If you prefer logical names that follow the VMS naming convention, F use TO-ALT.COM instead. In that case, the logical names would be TO_0,E TO_1, ..., TO_9. You can also use TO_HERE instead of TO_0 and TO_LAST ( instead of TO_1 when using TO-ALT.COM.)   F You can use these logical names in subsequent DCL commands or programsC to refer to previous defaults. You can use the logical name HERE to B mean the current default in DCL commands (for example in RENAME orD DIFFERENCES commands). This is better than using SYS$DISK:[] because< SYS$DISK:[] doesn't work when your default is something likeF SYS$STARTUP, and it's also less typing. The logical name HERE (TO_0 orD TO_HERE if you use TO-ALT.COM) is always your current default if you* always use TO.COM to change your default.   C Run TO.COM without any arguments to display the logical-name recall F stack. To switch to one of the defaults listed, type the number of the? default and press Return. Alternatively, you can type any valid @ default at the prompt according to the rules for the new-default parameter.    	 Example:     $ TO   3 Enter   3   for 3BACK = DISK$DATA1:[FELDMAN.FT.COM] 8 Enter   2   for 2BACK = DISK$DATA1:[FELDMAN.UTI.GENERAL]2 Enter   1   for  LAST = DISK$DATA1:[FELDMAN.CHECK]3 Press <RET> for  HERE = DISK$DATA1:[FELDMAN.MONREM]  Or enter new default:   2 K ===========================================================================   ) Checking DISK$DATA1:[FELDMAN.UTI.GENERAL]    MATCH = 2    3                 3BACK = DISK$DATA1:[FELDMAN.FT.COM] 2                 2BACK = DISK$DATA1:[FELDMAN.CHECK]3                  LAST = DISK$DATA1:[FELDMAN.MONREM] 8                  HERE = DISK$DATA1:[FELDMAN.UTI.GENERAL]    Your default is "   DISK$DATA1:[FELDMAN.UTI.GENERAL]    $     F The program TO.COM avoids duplicate entries in the logical-name recallB stack. This holds true even if you specify different default-specsD which refer to the same actual directory. For example, a disk can beA specified in several ways and one can have multiple logical names  pointing to the same default.   = However, there are exceptions: Aliases that point to the same @ directory are treated as if they were different. Also, differentE search-list logical names that point to the same list of defaults are F treated as if they were different. But defaults of the same exact name4 will normally not appear twice in the recall stack.      *** PARAMETERS ***     P1: [new-default]   C Specify [disk:][directory], a logical_name, or a reserved keyword.    B (You can also specify two defaults separated by a comma -- see the; section titled TWO-STEP NEW-DEFAULT FUNCTION for details.)    F Specifying [disk:][directory] takes you to that default. The directory$ brackets are optional. For example,        $ TO USERDISK:FELDMAN   . is legal and takes you to USERDISK:[FELDMAN].   D NB: TO.COM fills in missing directory brackets only when P1 is not a@ logical name; i.e., logical names used with TO.COM must still beC defined according to normal VMS RMS rules. Therefore, if you have a C logical name that was defined to be "USERDISK:FELDMAN", the FELDMAN < part would be interpreted by TO.COM as the name portion of a& file-spec, not the directory portion.   D If you specify a logical name, TO.COM performs iterative translationC thereof and sets default to the result. Iterative translation stops E when TO.COM reaches a concealed, a terminal, or a search list logical F name. Iterative translation also stops, of course, when an equivalence7 name is encountered that is not itself a logical name.    B The equivalence name (after iterative translation) may contain any) file-spec components except a node-spec.    C If P1 is a logical name pointing to a file, TO.COM uses F$SEARCH to E look for the file. If the file is found, the device and directory are A extracted from the F$SEARCH result. If the file is not found, the ? device and directory are extracted from the logical name (after  iterative translation).   E If the logical name is a search list that points to various files and : none of the files are found, TO.COM will report an error.   < If the first translation of a logical name starts with the @D character, the @ character is removed and processing continues. This/ is useful for logical names like SYS$ANNOUNCE.      B You can use the following reserved keywords for new-default (P1):   D -8 thru -1:  Go up minus that many directory levels. Example:  TO -3 is the same as  TO [---] .    B 1 thru 9:  Go to that entry in the logical-name recall stack. (TheD upper limit of 9 assumes the default stack size.) Leading zeros willA cause TO.COM to interpret P1 as a directory-spec. See the section 9 titled "LOGICAL-NAME RECALL STACK" for more information.    6 H, -HELP, or ?:  Display the 23-line quick-help page.   D L - Go to the LOST default: If you use another program to change theC default, then run TO.COM to change the default, TO.COM will put the A default set by the other program into the LOST slot. That is, the F logical name LOST will be defined to be that default. TO.COM then setsC default to the new default, puts the previous default set by TO.COM C into the LAST slot, and bumps the other entries up one level in the C recall stack. However, if the new default does not exist, or if you F had run TO.COM with P1 null, the default set by the other program willF become the current default and the entries in the stack will be bumped@ up one level. The logical name LOST and its equivalence name areA displayed in the logical-name recall stack if and only if LOST is 	 defined.    D S - Go to saved default: This is the default that is assigned to theF logical name SAVE by SAVE.COM. When you are in a default that you wishE to save, run SAVE.COM. The logical name SAVE and its equivalence name E are displayed in the logical-name recall stack if and only if SAVE is 3 defined. (SAVE.COM is supplied with this package.)    F T - Go to the top level of the current directory tree. For example, if? your current default is  disk:[AAA.BBB.CCC],  this takes you to  disk:[AAA].     D \ - This is equivalent to [000000]. It can be used with or without a disk spec. Both             $ TO new-disk:\     and             $ TO \      are legal.       .. - Same as [-]      D Note: To set default to directories named [H], [L], [S], [T], or [n]C where n is a positive integer .LE. the stack size, include at least F one of the brackets. See the PRECEDENCE section for more information.      *** PRECEDENCE ***    D In the case of P1 containing no colons or brackets it is interpreted with the following precedence:    0 	reserved keywords, logical names, directories.   F Use a trailing colon or bracket to force the desired interpretation ifD necessary. For example, to go to a directory named  [2],  you shouldE run  TO 2]  or  TO [2],  but not  TO 2.  TO.COM was designed this way C with the assumption that people don't normally use single-character F directory names. But TO.COM can be easily modified to require a hyphen= before T, L, S, and H if desired. Edit the file and go to the E _CHECK_FOR_KEYWORDS subroutine and change "H", "L", "S", "T" to "-H", E "-L", "-S", "-T", respectively, and you can update the help screen at 0 the bottom of the file to reflect your changes.     & *** TWO-STEP NEW-DEFAULT FUNCTION ***    Format:   F $ TO default-1,default-2      ! go to default-1 and from there go to  '                             ! default2    4 (There must be no spaces or tabs around the comma.)   B This is useful when default-1 is a stack entry number or a logical? name which is "partly correct" and default-2 is an easy-to-type C "correction". Basically, TO.COM goes to default-1, and then goes to = default-2 "from there". Note that relative directory-specs in @ default-2 are relative to default-1 and not to the old default.   	 Example:    6 Your current default is DISK1:[USER], stack entry 3 is) DISK3:[HELLO.THERE] and you wish to go to # DISK3:[HELLO.THERE.MY.FRIEND]. Run         $ TO 3,.MY.FRIEND   ? to accomplish this task. Note that in this example the relative D directory-spec is relative to the value of stack entry 3, not to the9 old default. Feel free to be creative with this feature.      @ P2: [save-def] - By default, TO.COM saves the old default in the< logical-name recall stack. You can override this behavior byF specifying N for this parameter in which case the old default will not be saved in the recall stack.     = P3: [DCL-verification] - Specify 1 or Y to enable DCL command E verification. DCL verification will be restored to its previous state / upon exit. The default is no DCL verification.         *** USER SETTINGS ***   A TO_BRIEF: By default, TO.COM tells you which stack entry your new F default matches if any. For example, if you type in a new-default thatF happens to match stack entry 3, TO.COM will display "MATCH = 3". Also,D by default, TO.COM displays the full logical-name recall stack afterD processing a new default. Define the logical name TO_BRIEF to "TRUE"C if you want TO.COM to omit the MATCH line and the "outgoing" recall B stack. You can set the symbol TO_BRIEF near the top of the code toE TRUE or 1 to make it the default. Note that the logical name TO_BRIEF @ takes precedence over the initial value of the symbol TO_BRIEF.   B STACK_SIZE: If you don't like the default size of 9 for the recall> stack, you can change it by setting the STACK_SIZE symbol to aE different positive integer. You will find this symbol near the top of E the file. Note that making the stack size very large will slow TO.COM E considerably. Better stack manipulation algorithms would be needed in  that case.       *** FEEDBACK ***    F If you have any questions, comments, or problems with regard to TO.COMC you can write to me at spamsink2001(a)yahoo.com (yes, that's a real 0 e-mail address -- replace (a) with an at-sign).      Alan E. Feldman   