A TO.COM v5.2	Author: Alan E. Feldman         alanedfeldman\a\yahoo     E This is a SET DEFAULT program for use with Files-11 ODS-2 volumes. 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 D typing. I haven't tried it on ODS-5 volumes so I don't know how well it would work on such volumes.         *** NEW IN v5.2 ***   3 o  Wildcards are now supported in directory-specs.  B o  Write and read the logical name recall stack to and from disk. 4 o  Some minor bug fixes and improved program logic. ; o  New versions of the auxiliary programs SAVE_DEFAULT.COM, E DIR-MENU.COM, CLEAR-TO-LNMS.COM, CLEAR-NBACK-LNMS.COM, and OVER.COM.      
 CONTENTS:    CONVENTION   INSTALLATION  
 QUICK START    FORMAT  
 DESCRIPTION        LOGICAL NAME RECALL STACK    PARAMETERS     P1
     WILDCARDS      LOGICAL NAMES      KEYWORDS     PRECEDENCE  #     TWO-STEP NEW-DEFAULT FUNCTION      P2   P3 USER OPTIONS     STACK SIZE.     PUT THE CURRENT DEFAULT IN YOUR DCL PROMPT     BRIEF VS. VERBOSE OUTPUT     LOGICAL-NAME STYLE
 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 :== @<location>TO.COM  '     $ TO -INIT  ! to initialize TO.COM    D where <location> can be either disk:[dir] or a logical name pointingD to the location of TO.COM. Ensure that both commands above have been run before using TO.COM.       *** QUICK START ***   ) After installing TO.COM (see above), run         $ TO ?    A to get the 23-line quick-help page. This page summarizes the most A important aspects of TO.COM. Then use TO.COM as you would the SET  DEFAULT command.       *** FORMAT ***    :     $ TO  [new-default] [save-old-def] [DCL-verification]   4 Use "" as a placeholder for any skipped parameters.      *** DESCRIPTION ***   A Use TO.COM as you would use the SET DEFAULT command. As you visit F different defaults (directories), TO.COM automatically saves up to theD last 9 defaults in its logical name recall stack. Run TO.COM withoutD any arguments to display the recall stack and enter interactive mode? from which you can select one of the stack entries, enter a new " default, or press Return to exit.      TO.COM has features that   o  save you typing, o  perform iterative logical name processing o  deal with bad defaults    Features that save you typing:    B Directory brackets are optional -- let the program figure it out!   > The logical name recall stack saves recently visited defaults.A Reference stack entries via numbers inside TO.COM and via logical  names outside of TO.COM.    ? The logical name recall stack is efficient: it avoids duplicate  entries in most cases.    D The logical name recall stack can now (as of v5.2) be written to and8 read from disk, saving typing across terminal sessions.   E Another way that TO.COM saves you typing is with the two-step default B function. This is most useful if you can specify the first defaultE very quickly via a recall-stack slot number or logical name, and then C the second default as a "correction" relative to the first. See the 3 TWO-STEP NEW-DEFAULT FUNCTION section for details.    F There are shortcut keys for MFD, SYS$LOGIN, top-level directory, and n levels up.    1 Wildcard support allows you to use wildcards as a   quasi--name-completion feature.     $ Iterative logical name translation:   0 Iterative logical names are processed properly.      Dealing with bad defaults:    F TO.COM should not normally put you in a bad default. It should also beC able to recover from nearly any bad-default situation. (If for some D reason you need to go to a non-existent default, use the SET DEFAULT
 command.)      In more detail:   F When you run TO.COM it processes the old and new defaults, reports anyC problems that it finds, and performs appropriate actions. If all is ? well it will then set default to the new default; otherwise, an D appropriate error message is displayed. If the new default was 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 inE updating the logical name recall stack and/or the new-default was not 3 set, TO.COM will let you know just before exiting.    D If you run TO.COM without any arguments, it will display the logicalA name recall stack and prompt you for a new default. (There is one F exception to this: If you run TO.COM without any arguments and haven'tB initialized TO.COM yet [by having run it with or without the -INIT> parameter], you get the HELP screen instead [but only once].)   - TO.COM is designed for interactive use only.    * Running TO -INIT repeatedly does no harm.     " *** 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 TO_1, bumps the other stack entries up one level, and assigns theB new default to the logical name TO_0. 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:    	TO_0 - current default  	TO_1 - last default 	TO_2 - 2 defaults back  	. 	.         TO_9 - 9 defaults back  F You can use these logical names in subsequent DCL commands or programsC to refer to previous defaults. You can use the logical name TO_0 to C mean the current default in subsequent DCL commands. This is better A than using SYS$DISK:[] because SYS$DISK:[] doesn't work when your E default is something like SYS$STARTUP, and it's also less typing. The B logical name TO_0 is always your current default if you always useC TO.COM to change your default, even when TO.COM exits because of an D error or a control-Y interrupt. You can use the logical name TO_HERE instead of TO_0 if you prefer.    B Two auxiliary logical names are provided: TO_LOST and TO_SAVE. TheD TO_LOST slot is for saving defaults set by other programs that would@ otherwise be "lost" when running TO.COM. The TO_SAVE slot is for< defaults saved with the auxiliary program SAVE_DEFAULT.COM.   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.    ; TO.COM will display only stack entries that are not empty.    	 Example:     $ TO   , Enter   3   for  TO_3 = DISK$DATA1:[FELDMAN]2 Enter   2   for  TO_2 = DISK$DATA1:[FELDMAN.CHECK]8 Enter   1   for  TO_1 = DISK$DATA1:[FELDMAN.UTI.GENERAL]M Press <RET> for  TO_0 = DISK$DATA1:[FELDMAN.UTI.DEFAULT]  ! (current default)  Or enter new default:   2 O ===============================================================================    # Checking DISK$DATA1:[FELDMAN.CHECK]    MATCH = 2    ,                  TO_3 = DISK$DATA1:[FELDMAN]8                  TO_2 = DISK$DATA1:[FELDMAN.UTI.GENERAL]8                  TO_1 = DISK$DATA1:[FELDMAN.UTI.DEFAULT]G                  TO_0 = DISK$DATA1:[FELDMAN.CHECK]  ! (current default)     Your default is    DISK$DATA1:[FELDMAN.CHECK]    $   F The program TO.COM avoids duplicate entries in the logical name recallB stack. This holds true even if you specify different default-specsC that refer to the same actual default. For example, a specific disk B can be 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 B directory are treated as if they were different directories. Also,@ different search list logical names that independently translateD iteratively to the same list of equivalence names are not recognized as being identical by TO.COM.   A Regardless, the same default-spec-string will not normally appear E twice in the recall stack. One exception is when you abort TO.COM via E control-Y while it is updating the logical name recall stack. Another D exception is that the values of TO_LOST and TO_SAVE may by chance be- duplicated in the regular part of the stack.    F TO.COM offers an alternate set of logical names for the recall stack:    	HERE - current default  	LAST - last default        2BACK - 2 defaults back        3BACK - 3 defaults back            .            .        9BACK - 9 defaults back         LOST - same as TO_LOST         SAVE - same as TO_SAVE  C To use these logical names instead of the default style TO_0, TO_1, A ..., DEFINE the logical name TO_BACK to 1 (true). See the section / LOGICAL-NAME STYLE for additional information.       *** 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 the9 section titled TWO-STEP NEW-DEFAULT FUNCTION for details. D Additionally, wildcards are allowed in the directory-spec -- see the/ WILDCARDS section below for more information.)    F Specifying [disk:][directory] takes you to that default. The directory$ brackets are optional. For example,        $ TO USERDISK:FOO   * is legal and takes you to USERDISK:[FOO].   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 beE defined according to normal VMS RMS rules. Therefore, if you define a  logical name thusly...          $ DEFINE MYDIR USERDISK:FOO   
 and then run         $ TO MYDIR    F the FOO part would be interpreted by TO.COM as the name component of a7 file-spec, not the directory component. But if you run         $ TO USERDISK:FOO   B the FOO portion of the string will be interpreted as the directory specification [FOO] !.       *** WILDCARDS ***   F You can use wildcards in new-default. TO.COM uses F$SEARCH to look forE .DIR;1 files that match your wildcarded directory-spec. Each matching D directory will be offered to the user as it is found. You can type Y$ to accept, N to skip, or Q to quit.   F Note that some wildcarded directory-specs may take a while to process.F Also, directory-specs that have a trailing ellipsis are not supported.F You can, however, use a trailing ...* instead. There is no significant' loss of functionality because of this.       *** LOGICAL NAMES ***   D If you specify a logical name, TO.COM performs iterative translation@ and sets default to the result. Iterative translation stops whenF TO.COM reaches a concealed, a terminal, or a search list logical name.E Iterative translation also stops, of course, when an equivalence name 2 is encountered that is not itself a logical name.   E The equivalence name (after iterative translation as specified above) > may contain any file-spec components except a node-spec. If itA contains name, type, or version components, it is assumed to be a D file-spec and TO.COM uses F$SEARCH to look for a matching file. If aC matching file is found, the device and directory are extracted from A the F$SEARCH result. If no matching file is found, the device and ' directory are extracted using F$PARSE.    E If the logical name is a search list that points to various files and D none of the files are found, TO.COM will set default to the disk and: directory extracted from the first file-spec in the list.   < If the first translation of a logical name starts with the @A character, the @ character is removed and TO.COM then looks for a C matching file. This is useful for logical names like SYS$ANNOUNCE.       *** KEYWORDS ***    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 that the stack is set to its default size.)D Leading zeros will cause TO.COM to interpret P1 as a directory-spec.; See the section titled "LOGICAL NAME RECALL STACK" for more 
 information.    6 H, -HELP, or ?:  Display the 23-line quick-help page.   C L - Go to the TO_LOST default. If you use another program to change C the default, then run TO.COM to change the default, TO.COM will put F the default set by the other program into the TO_LOST slot if it would" otherwise be lost from the stack.   D R - Read the saved logical name recall stack from disk. The stack is" read from SYS$LOGIN:TO_STACK.DAT.   D S - Go to the saved default. This is the default that is assigned to? the logical name TO_SAVE by SAVE_DEFAULT.COM. When you are in a F default that you wish to save, run SAVE_DEFAULT.COM. (SAVE_DEFAULT.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].   E W - Write the logical name recall stack to disk. The stack is written  to SYS$LOGIN:TO_STACK.DAT.      D \ - This is equivalent to [000000]. It can be used with or without a disk-spec. Both             $ TO new-disk:\     and             $ TO \      are legal.      A .. - Same as [-] and it can be used with or without a disk-spec.      ~ (tilde) - Same as SYS$LOGIN .     B Note: To set default to directories named [H], [L], [R], [S], [T],F [W], or [n] where n is a positive integer .LE. the stack size, includeF at least one of the brackets. To set default to logical names H, L, R,C S, T, W, or n, include a trailing colon. 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:    . 	reserved keywords, logical names, directories  E Use a trailing colon or a bracket to force the desired interpretation F if necessary. For example, to go to a directory named  [2],  you wouldE 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 A directory names. If you wish to modify TO.COM to require a hyphen D before the single-letter keyword you'll have to check for and removeF any leading hyphen just before the statement GOSUB _CHECK_FOR_KEYWORDS< and skip this GOSUB command if there was no leading hyphen.     & *** TWO-STEP NEW-DEFAULT FUNCTION ***   B The idea for this function was borrowed from a comp.os.vms post by' Hunter Goatley about his "SD program".     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.)   @ This is useful when default-1 is a stack entry, logical name, orB keyword which is "partly correct" and default-2 is an easy-to-typeC "correction". Basically, TO.COM goes to default-1, and then goes to = default-2 "from there". Note that relative directory-specs in F default-2 are relative to default-1 and not to the old default, which,8 of course, is precisely what makes this feature useful.   	 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 the= current default. Feel free to be creative with this feature.      D P2: [save-old-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 OPTIONS ***      5 The following can be found near the top of the code:     $!!  *** User Settings ***M $    STACK_SIZE = 9     ! Total number of slots in logical name recall stack. I $    TO_PROMPT = 0      ! If true, set prompt string to current default. dN $    TO_BRIEF = 0       ! If true, omit match value and outgoing recall stack.F $    TO_BACK = 0        ! If true, use old nBACK-style logical names.   B These are the out-of-the-box defaults for these features. Edit theD file to change them if you wish. The last three can be overridden by< defining the logical names TO_PROMPT, TO_BRIEF, and TO_BACK,C respectively, to 0 (false) or 1 (true) as desired. Details follow. i     *** STACK_SIZE *** a  E If you don't like the default size of 9 for the recall stack, you canpB change it by setting the STACK_SIZE symbol to a different positiveF integer. You will find this symbol near the top of the file. Note thatE making the stack size very large may slow TO.COM considerably. Better < stack-manipulation algorithms would be needed in that case.     3 *** PUT THE CURRENT DEFAULT IN YOUR DCL PROMPT ***    F TO.COM can put the current default in your DCL prompt. Run the command       $ DEFINE TO_PROMPT 1    C to enable this feature. Note that if your current default is longerBA than is longer than 31 characters, TO.COM will truncate it on the*F left. To disable this feature, either re-DEFINE TO_PROMPT to 0 (false)F or DEASSIGN it. In either case, finish by running the DCL "SET PROMPT"3 command to clear the last default from the prompt.    E The out-of-the-box default for this feature is 0 (false). If you want E to enable this feature without using the logical name, go to the Usero3 Settings section at the top of the code and change o       $ TO_PROMPT = 0    to T       $ TO_PROMPT = 1   > Note that the logical name takes precedence over this symbol.      *** TO_BRIEF *** -  ? By default, TO.COM tells you which stack entry your new defaulteF matches if any. For example, if you type in a new-default that happensA to match stack entry 3, TO.COM will display "MATCH = 3". Also, byCA default, TO.COM displays the full logical name recall stack aftereD processing a new default. Define the logical name TO_BRIEF to "TRUE"A or "1" if you want TO.COM to *not* display the MATCH line and theO> "outgoing" recall stack. Alternatively, you can set the symbolF TO_BRIEF near the top of the code to TRUE or 1 to make it the default.D Note that the logical name TO_BRIEF takes precedence over the symbol
 TO_BRIEF.      *** LOGICAL-NAME STYLE *** o  A As mentioned at the end of the LOGICAL NAME RECALL STACK section, > there are two styles of logical names available with TO.COM .   . TO_n style:  TO_0, TO_1, ..., TO_LOST, TO_SAVE6 nBACK style: HERE, LAST, 2BACK, 3BACK, ..., LOST, SAVE  B The out-of-the-box default is the TO_n style. This follows the VMSA naming convention which minimizes the risk of conflicting logical E names. But the nBACK style is easier to use (in the author's opinion)cB and can be used if it does not conflict with logical names on your system.   F To use the nBACK style, edit TO.COM. Near the top of the file you will' find the User Settings section. Change         $ TO_BACK = 0    to e       $ TO_BACK = 1   F Note that TO.COM also supports the logical name TO_BACK. Defining thisF logical name to 0 (false) or 1 (true) overrides the value specified inF the file. Additionally, if this logical name is undefined, TO.COM willC define it to be the value it is set to in the file. This is done in B order to let SAVE_DEFAULT.COM know which style you are using. ThisD way, SAVE_DEFAULT.COM knows whether to assign the current default to logical name SAVE or TO_SAVE.   A If you change from nBACK style TO_n style in the same interactiveeC session, any nBACK-style logical names will be "left over" and willMA not be updated further. If you want to clear these leftovers, runbD @CLEAR-NBACK-LNMS.COM. If you change from TO_n style to nBACK style,@ no such problem arises as the TO_n logical names are always keptD current while the nBACK-style logical names are defined based on the> corresponding TO_n-style logical names when the nBACK style is	 enabled. s    	 Summary: t  5 TO_BACK = 0  ! Use TO_0, TO_1, ..., TO_LOST, TO_SAVE w= TO_BACK = 1  ! Use HERE, LAST, 2BACK, 3BACK, ..., LOST, SAVE d    D Remember that the logical name has precedence over the symbol in theF User Settings section in the file. Therefore, if you change the symbolE value in the file, be sure that the logical name is defined accordingt to your wishes.   D If for some reason you wish to DEASSIGN all logical names created by5 TO.COM and SAVE_DEFAULT.COM, run @CLEAR-TO-LNMS.COM. e     *** FEEDBACK *** .  ? If you have any questions, comments, or problems with regard toi9 TO.COM, please write the author at betaneptune\a\yahoo orl alanedfeldman\a\yahoo. r