home *** CD-ROM | disk | FTP | other *** search
/ EigenPC: Software Surprise / image.IMA / SPRST161.ZIP / SUPERSET.DOC < prev   
Encoding:
Text File  |  1991-07-06  |  30.8 KB  |  841 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                              SuperSET (Version 1.61)
  8.  
  9.  
  10.         SuperSET is a DOS environment utility which does many of the same
  11.         things the internal SET command does, and a few more.
  12.  
  13.                               ABOUT THE SET COMMAND
  14.  
  15.         (If the DOS SET command holds no mysteries for you, please skip
  16.         ahead to page 4.)
  17.  
  18.         SET is an internal DOS command which, as outlined in the IBM Disk
  19.         Operating System(tm) manual (version 3.20), "inserts strings into
  20.         the command processor's environment.  A copy of the entire series
  21.         of strings in the environment is made available to all commands
  22.         and applications."
  23.  
  24.         This means that at boot time, or any time thereafter that
  25.         COMMAND.COM is run, an area of the computer's random access
  26.         memory (RAM, or "user memory") is reserved as a sort of board
  27.         room where you and DOS can get together to agree on certain
  28.         things.  DOS uses the environment, even if you don't, by
  29.         automatically generating a string giving the name and location of
  30.         COMMAND.COM.  This is necessary because COMMAND will relinquish a
  31.         portion of its own memory if required by your programs and must
  32.         be able to find itself on disk afterward to reload its missing
  33.         code.  If you enter "SET" from the "A>" prompt after booting from
  34.         your original DOS diskette, you will see something like:
  35.  
  36.              A>set
  37.              PATH=
  38.              COMSPEC=A:\COMMAND.COM
  39.  
  40.         If you alter your DOS prompt via the PROMPT command to "$p$g", it
  41.         will look like this:
  42.  
  43.              A:\>
  44.  
  45.         and your environment will look like this:
  46.  
  47.              PATH=
  48.              COMSPEC=A:\COMMAND.COM
  49.              PROMPT=$p$g
  50.  
  51.         The PATH is where DOS will look for any .COM, .EXE, or .BAT file
  52.         you enter from the command line if it's not in your current
  53.         directory.  The "PATH=" string has no value (or perhaps I should
  54.         say it has a null value), so DOS would give up looking for a
  55.         program if it was not in the current directory.  Why DOS bothers
  56.         to put a null variable in the environment escapes me, but it
  57.         does.  You can eliminate the "PATH=" string from the environment
  58.         all together by running:
  59.  
  60.                                    1
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.              SET PATH=
  69.  
  70.         and it will be gone with no (apparent) adverse effects.
  71.  
  72.         Using the SET command (as well as the PATH and PROMPT commands),
  73.         we can add environment strings, delete them, or replace them.
  74.         The syntax for doing so is:
  75.  
  76.              SET [<name>=[<parameter>]]
  77.  
  78.         or, as I prefer to think of it:
  79.  
  80.              SET [<variable>=[<value>]]
  81.  
  82.         When run, the "<variable>" portion of the string will be capital-
  83.         ized by DOS, but otherwise the string will appear as entered the
  84.         next time you run SET by itself.
  85.  
  86.         A few programs, notably C language compilers, require that cer-
  87.         tain strings be SET before they are run.  DOS passes a copy of
  88.         the environment to each program it runs, and these programs ex-
  89.         tract user-specific information from this copy to "customize" the
  90.         way they work.  Here is an example used with Microsoft QuickC:
  91.  
  92.              set INCLUDE=c:\include
  93.              set LIB=c:\lib
  94.              set TMP=c:\tmp
  95.  
  96.         In this case, each of the programs associated with the QuickC
  97.         compiler will know which directories on which drives certain
  98.         programs are stored in by checking the values of INCLUDE, LIB,
  99.         and TMP.
  100.  
  101.         Environment variables can be used in batch files for most ver-
  102.         sions of DOS (excepting 3.0 -- I'd upgrade if I owned it), by
  103.         using the "%<variable>%" construction.  For example, consider the
  104.         following segment of a batch file:
  105.  
  106.              set oldpath=%path%
  107.              path c:\docs;c:\dict;c:\thes;c:\outliner;%path%
  108.              cd wordproc
  109.              myword
  110.              cd\
  111.              path %oldpath%
  112.              set oldpath=
  113.  
  114.         In this case, the current value of "PATH=" from the environment
  115.         is stored in a new variable called "OLDPATH".  The PATH is
  116.         changed to prepare for the requirements of the word processing
  117.         program that is run next.  Upon exiting the word processor, the
  118.  
  119.  
  120.                                    2
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.         PATH is restored to the value of OLDPATH, which is then deleted
  128.         by the last line, and the environment is returned to its previous
  129.         state.
  130.  
  131.         A problem users face when working with the environment (and,
  132.         perhaps, a reason it is often largely ignored) is the stiffness
  133.         of the SET command itself.
  134.  
  135.         If you view your environment as a sort of database of strings,
  136.         which it is, the SET command does not rate well as a database
  137.         manager.  It allows appends, replacements and deletions, one at a
  138.         time, and will generate complete listings of the current contents
  139.         of the environment.  For a very small data base, this may be
  140.         enough, but it is possible to expand the DOS environment (up to
  141.         32 kilobytes in DOS 3.2 and up) to include many dozens of strings
  142.         of various lengths.  (For a quick course on achieving an environ-
  143.         ment larger than the default size with old versions of DOS, lo-
  144.         cate a copy of PC Magazine, April 14, 1987, Volume 6, Number 7
  145.         which contains an article entitled "Expanding the DOS Environ-
  146.         ment".  DOS versions 2.0 to 3.1 are capable of working with en-
  147.         vironment sizes up to 992 characters.  The article refers to the
  148.         (Microsoft) DOS SETENV utility, has an undocumented CONFIG.SYS
  149.         command for DOS 3.0 and 3.1, and DEBUG patches for COMMAND.COM as
  150.         well.  Anyone with DOS versions 3.2 or greater can use the
  151.         "SHELL=" with the "/E" parameter as outlined in their DOS
  152.         manuals.  I find an environment of 512 bytes adequate for any-
  153.         thing I'd like to do.)
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.                                    3
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.                                  ABOUT SUPERSET
  188.  
  189.         And so we come to SuperSET.  This utility, written in Turbo Pas-
  190.         cal, is a management tool for your DOS environment.  It does most
  191.         of the same things SET does, and many more.  It will, on demand,
  192.         sort your environment alphabetically by variable name, allow you
  193.         to prompt for new environment strings from a batch file, store
  194.         your current drive, directory, the date and the time in the en-
  195.         vironment, save your environment to a disk file or recall it from
  196.         one, clear your environment entirely or selectively, display
  197.         values for all or specific variables, create files with unique
  198.         names for your batch files, and allow you to process a number of
  199.         environment commands on a single command line.
  200.  
  201.         I have already noted the %<variable>% construction most DOS ver-
  202.         sions use in batch files.  If you try using this construction on
  203.         the command line (that is, from the DOS prompt), it won't work,
  204.         except with SuperSET.  Whenever SuperSET encounters an even num-
  205.         ber of per-cent signs in a command line instruction, it will per-
  206.         form the appropriate substitutions.  If there is an odd number of
  207.         per-cent signs in the instruction, the first occurrence of '%'
  208.         within the instruction is deleted, and the rest of the instruc-
  209.         tion is treated without substitutions.  Confused?  Of course!
  210.         You may never understand nor use this feature, but just for fun
  211.         try this from the DOS prompt:
  212.  
  213.              C:\>sset 123=%%456% 456=789 %123%=123 @dsp
  214.  
  215.         You should get a nice display of your environment with the fol-
  216.         lowing strings added:
  217.  
  218.                   123=%456%
  219.                   456=789
  220.                   789=123
  221.  
  222.         To make this feature useful in batch files (where DOS gets first
  223.         shot at per-cent signs), a tilde ('~') may be substituted for any
  224.         '%':
  225.  
  226.              @echo off
  227.              rem  Fakes a DOS "$p$g" prompt
  228.              :DosPrompt
  229.              sset @drv @dir @inp("~currdrv~~currdir~>"^doscom^c)
  230.              if errorlevel 255 goto end
  231.              if !%doscom%==! goto end
  232.              call %doscom%
  233.              goto DosPrompt
  234.              :end
  235.  
  236.         The syntax for SuperSET is:
  237.  
  238.              [d:][path]SSET [<command> [<command>...]]
  239.  
  240.                                    4
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.         where "command" is one of the following:
  249.  
  250.         1.   Not given.
  251.  
  252.              If SSET is entered without parameters, it will display the
  253.              contents of the entire environment.  Unlike the DOS SET com-
  254.              mand, however, SuperSET displays the location of the en-
  255.              vironment in RAM, the size of the environment, the number of
  256.              characters and variables used, and the number of characters
  257.              remaining for use.  (See the @DSP function, below, for a way
  258.              to emulate the SET command output.)
  259.  
  260.              See also:  @DSP
  261.  
  262.         2.   <variable>=[<value>]
  263.  
  264.              Space permitting, if <value> is given then a string is ap-
  265.              pended to the end of the environment in the form:
  266.  
  267.                   <variable>=<value>
  268.  
  269.              <variable> will be converted to its upper case equivalent if
  270.              need be.  If <variable> is already in the environment, the
  271.              original record of it will be deleted, together with its old
  272.              value.
  273.  
  274.              If <value> is not given, then <variable> is deleted from the
  275.              environment.  An asterisk ("*") wild card is allowed at the
  276.              end of each <variable>=, so a number of strings with names
  277.              that begin the same way may be deleted in one command.  For
  278.              example:
  279.  
  280.                   sset temp*=
  281.  
  282.              would delete environment strings with such names as TEMP,
  283.              TEMP1, TEMP VAR, TEMPEST, and TEMPORARY.
  284.  
  285.              A major difference in the way SuperSET and SET handle as-
  286.              signments of this sort is caused by SuperSET's ability to
  287.              handle more than one command in a single command line.  Be-
  288.              cause SuperSET parses spaces as parameter separators, it is
  289.              necessary to enclose multiple word parameters in quotation
  290.              marks.  Thus:
  291.  
  292.                   set query=What is your name?
  293.  
  294.              can be emulated by:
  295.  
  296.                   sset query="What is your name?"
  297.  
  298.  
  299.  
  300.                                    5
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.              If you need to enter a quotation mark into the environment,
  308.              use two quotation marks together in your command line:
  309.  
  310.                   sset riddle="Who wrote ""The Lost Chord?""
  311.  
  312.              The DOS SET command, because it is contained in the resident
  313.              portion of DOS and is therefore faster, should be used
  314.              wherever practical for routine changes to the environment.
  315.              (Incidentally, Sir Arthur Sullivan wrote "The Lost Chord.")
  316.  
  317.  
  318.              See also:  @ZAP
  319.  
  320.         3.   @BOT
  321.  
  322.              All subsequent commands will work with the environment
  323.              created by the last PERMANENTLY loaded copy of COMMAND.COM.
  324.              To see the effect of this, type the following at the DOS
  325.              prompt:
  326.  
  327.                   C:\>set this=that
  328.                   C:\>sset
  329.                   C:\>command
  330.                   C:\>sset
  331.                   C:\>sset @dsp @bot this=
  332.                   C:\>sset
  333.                   C:\>exit
  334.                   C:\>sset
  335.  
  336.              See also:  @TOP
  337.  
  338.         4.   @DAT
  339.  
  340.              Places a variable called DATE into the environment whose
  341.              value is the current date as reported by DOS.  The date is
  342.              stored in a format compatible with the DOS DATE command and
  343.              will vary according to the version of DOS used and the value
  344.              of the COUNTRY= line (if present) in your CONFIG.SYS file.
  345.  
  346.              See also:  @TIM
  347.  
  348.         5.   @DIR
  349.  
  350.              The current directory will be placed in the environment, as-
  351.              signed the variable name "CURRDIR".
  352.  
  353.              See also:  @DRV
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.                                    6
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.         6.   @DOW
  368.  
  369.              Places a variable called DAY OF WEEK into the environment
  370.              whose value is the name (i.e., Sunday, Monday, etc.) of the
  371.              current day as reported by DOS.
  372.  
  373.         7.   @DRV
  374.  
  375.              The current drive letter (and accompanying colon) will be
  376.              placed in the environment, assigned the variable name
  377.              "CURRDRV".
  378.  
  379.              The @DIR and @DRV functions are useful for batch files on
  380.              your PATH that might be run from any directory or drive.  If
  381.              such a batch file changes drives or directories mid-
  382.              operation, CURRDIR and CURRDRV will help to restore the user
  383.              to his or her original location.  Consider the following
  384.              batch file:
  385.  
  386.                   echo off
  387.                   cls
  388.                   sset @drv @dir
  389.                   c:
  390.                   cd \sk
  391.                   sk
  392.                   cd \
  393.                   %currdrv%
  394.                   cd %currdir%
  395.  
  396.              Assume you have Borland's SideKick in a directory on drive
  397.              C: called \SK and you wanted to start it from your work
  398.              directory , A:\WORK.  This batch file, SK.BAT, resides in a
  399.              directory listed in your PATH environment variable.  Super-
  400.              SET places the strings, "CURRDRV=A:" and "CURRDIR=\WORK" in
  401.              the environment before the batch logs on to C:, changes the
  402.              active directory there, and runs SideKick.  "A:" is
  403.              automatically substituted for %currdrv% on the next line,
  404.              logging us back onto A:, and "\WORK" is substituted for
  405.              %currdir% on the last line, giving us back our original
  406.              directory.
  407.  
  408.              See also:  @DIR
  409.  
  410.         8.   @DSP[(<variable>[^<variable>...])]
  411.  
  412.              Generates a list of existing environment strings.  Without
  413.              parameters, @DSP is identical in function to SuperSET
  414.              without parameters.  If a variable or variables are
  415.              specified, a simple list of corresponding variables and
  416.              values is displayed, in the same format used by the DOS SET
  417.              command, although a note is generated for any variable named
  418.              in the command line that is not in the environment.  This is
  419.  
  420.                                    7
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.              a quick way to determine whether or not a specific variable
  428.              is in the environment without scanning a lengthy list.  An
  429.              asterisk ("*") wild card is allowed at the end of each
  430.              <variable> (see item 2, above for more details regarding the
  431.              functioning of wild cards).
  432.  
  433.              The command:
  434.  
  435.                   sset @dsp(*)
  436.  
  437.              simulates (albeit slowly) the SET command run without
  438.              parameters (although I can't imagine why you'd want to do
  439.              this).
  440.  
  441.  
  442.         9.   @FIL
  443.  
  444.              Adds a number of strings to the environment of the form:
  445.  
  446.                   !FILLxxx=▓▓▓...▓▓▓
  447.  
  448.              where xxx is an hexadecimal number.  You may want to issue
  449.              this command prior to loading a program which allows you to
  450.              shell to DOS.  Such programs typically do not give you a
  451.              full environment to work in when they load COMMAND.COM on
  452.              top of themselves.  Instead, they will give you your current
  453.              environment strings and however many additional bytes it
  454.              takes to round the environment size out to a multiple of 16.
  455.              The @FIL function will ensure that enough space is taken up
  456.              in your current environment (with a minimum of 3 free bytes,
  457.              including the two "end-of-environment" markers) to guarantee
  458.              a full-sized copy when you shell to a new one.  To free the
  459.              room up in the new copy, use:
  460.  
  461.                   sset !fill*=
  462.  
  463.              having ensured, of course, that you won't simultaneously
  464.              erase an important string that also begins with "!FILL".
  465.              Remember to issue the same command when you quit your ap-
  466.              plication to clear the unwanted strings from your root en-
  467.              vironment.
  468.  
  469.         10.  @GET[(<filespec>)]
  470.  
  471.              Unless a different <filespec> is specified, appends all
  472.              strings listed in a file in the root directory of the cur-
  473.              rent drive called "ENVIRON.TXT" to the environment.  This is
  474.              the logical companion to the @SAV function, and uses files
  475.              in the format specified for that function.
  476.  
  477.              See also:  @SAV
  478.  
  479.  
  480.                                    8
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.         11.  @INP[([<prompt>^]<variable>[^<switch>])]
  488.  
  489.              If <prompt> exists, it will be displayed as entered on the
  490.              user's screen.  <prompt> may be up to 64 characters in
  491.              length The cursor waits to the immediate right of <prompt>
  492.              for user input, or at the left edge of the screen if no
  493.              <prompt> is given.  INP is the default variable name.
  494.  
  495.              The user's entry will be placed into the environment, as-
  496.              signed to <variable>.
  497.  
  498.              One switch may be used.  It must consist of a "/" followed
  499.              by a single character (upper or lower case).  Valid choices
  500.              are:
  501.  
  502.                   C    Do a carriage return/line feed at end of entry.
  503.                   U    Convert the whole entry to upper case.
  504.                   L    Convert the whole entry to lower case.
  505.                   F    Convert the first letter of the entry to upper
  506.                        case, and the rest to lower case.
  507.                   I    Convert the first letter of each word in the entry
  508.                        to upper case and the rest to lower case.
  509.  
  510.              The following example uses @INP to prompt for a person's
  511.              name in a batch file and issue an appropriate greeting:
  512.  
  513.                   echo off
  514.                   cls
  515.                   sset @inp(User Name^Hello.  What's your name? ^/i)
  516.                   ::  Note the space after "name?" in the above line.
  517.                   ::  If left out there would be no space between
  518.                   ::  the question and answer.
  519.                   echo Greetings and felicitations, %User Name%.
  520.  
  521.              See also:  @KEY
  522.  
  523.         12.  @KEY[([<prompt>^]<variable>[^<switch>[/h])]
  524.  
  525.              Works like @INP, above, but for single character input  The
  526.              user's next keystroke is returned to the environment.  If
  527.              this is a "control" character (ASCII 1 to 26) or [Esc]
  528.              (ASCII 27), the environment entry will be a "#" followed by
  529.              a decimal representation of the ASCII code.  If the key
  530.              pressed was a function or cursor key, the environment entry
  531.              will be a decimal representation of the scan code of the key
  532.              pressed.  KEY is the default variable name.
  533.  
  534.              Two switches are allowed, consisting of "/" followed by a
  535.              single character (upper or lower case).  The first may be
  536.              one of:
  537.  
  538.                   U    Convert the character to upper case (if required).
  539.  
  540.                                    9
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.                   L    Convert the character to lower case (if required).
  548.  
  549.              The second, if used, must be:
  550.  
  551.                   H    Hide, or don't display the keystroke.
  552.  
  553.              See also:  @INP
  554.  
  555.         13.  @MID(<string>,<start position>,<length>)
  556.  
  557.              Has the same effect on <string> as Turbo Pascal's COPY pro-
  558.              cedure or BASIC's MID$ function.  In other words, the func-
  559.              tion returns a substring of <string> to the environment, as-
  560.              signed to the variable name MIDSTRING.  The value returned
  561.              will be that portion of <string> which begins at <start
  562.              position> and encompasses <length> characters.  Thus, the
  563.              command:
  564.  
  565.                   sset @mid(albatross^3^3)
  566.  
  567.              A more complex example is:
  568.  
  569.                   sset @tim @mid(~time~^1^5) time=~midstring~
  570.  
  571.              which returns the current hour and minute to the environment
  572.              variable TIME instead of the usual @TIM function format.
  573.  
  574.         14.  @SAV[(<filespec>)]
  575.  
  576.              Unless a different <filespec> is specified, stores all en-
  577.              vironment strings in a file in the root directory of the
  578.              current drive called "ENVIRON.TXT".  The file is a simple
  579.              ASCII sequential file in which each line contains one en-
  580.              vironment string and ends with a carriage return.  It may be
  581.              edited with any ASCII-only text editor (like QEdit, or even
  582.              EDLIN), and any number of files created to suit a variety of
  583.              requirements.  If you aren't doing anything more with Super-
  584.              SET than using @SAV (i.e., if there is nothing else on your
  585.              command line), the DOS SET command will be faster:
  586.  
  587.                   C:\>set > c:\environ.txt
  588.  
  589.              Here, the normal output from the SET command (identical to
  590.              that of @SAV) is redirected to the file C:\ENVIRON.TXT.
  591.  
  592.              See also:  @GET
  593.  
  594.         15.  @SRT
  595.  
  596.              Sorts all environment strings alphabetically by variable
  597.              name.
  598.  
  599.  
  600.                                    10
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.         16.  @TIM
  608.  
  609.              Places a variable called TIME into the environment whose
  610.              value is the current time as reported by DOS.  The time is
  611.              stored in a format compatible with the DOS TIME command and
  612.              will vary according to the version of DOS used and the value
  613.              of the COUNTRY= line (if present) in your CONFIG.SYS file.
  614.  
  615.              See also:  @DAT
  616.  
  617.         17.  @TOP
  618.  
  619.              All subsequent commands will work with the environment
  620.              created by the last loaded copy of COMMAND.COM.  You should
  621.              only need to use this function to switch back to your tem-
  622.              porary environment after using @BOT previously on the same
  623.              command line.  To see the effect of this, type the following
  624.              at the DOS prompt:
  625.  
  626.                   C:\>set this=that
  627.                   C:\>sset
  628.                   C:\>command
  629.                   C:\>sset
  630.                   C:\>sset @dsp @bot this= @top @dsp
  631.                   C:\>exit
  632.                   C:\>sset
  633.  
  634.              See also:  @BOT
  635.  
  636.         18.  @TRU[(<file name>)]
  637.  
  638.              THIS FUNCTION ONLY WORKS IN DOS VERSIONS 3.0 AND GREATER.
  639.              If no parameter is given, then a path to the current direc-
  640.              tory is returned to the environment.  If a parameter is
  641.              given, it will be capitalized and expanded to a full path
  642.              name in the environment.  In either case, the associated
  643.              variable name will be TRUENAME.  This function makes use of
  644.              an undocumented DOS function (60h).
  645.  
  646.         19.  @UNA(<0..50>)
  647.  
  648.              Creates an environment variable, UNARY, which has a string
  649.              of n 1s as its value where n is the value of the parameter.
  650.              n must be an integer value in the range 0 to 50 (inclusive).
  651.  
  652.              This feature is included to permit FOR loops, and even
  653.              nested FOR loops within batch files.  Consider this simple
  654.              example:
  655.  
  656.                   @echo off
  657.                   sset counter= @una(%1)
  658.                   :looptop
  659.  
  660.                                    11
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.                     echo %1 %counter%1
  668.                     set counter=%counter%1
  669.                     if not !%counter%==!%unary% goto looptop
  670.                   shift
  671.                   set unary=
  672.                   set counter=
  673.                   if not !%1==! sset @una(%1)
  674.                   if not !%unary%==! goto looptop
  675.                   echo Done!
  676.  
  677.              which you might try running with the following command line
  678.              parameters:
  679.  
  680.                   50 50 50 50 50 5
  681.  
  682.              This will produce 255 iterations of the "echo %1 %counter%1"
  683.              command.  A more complex example, one with a nested FOR
  684.              loop, is the following:
  685.  
  686.                   @echo off
  687.                   sset @inp("1st num: "^n1^/c) @inp("2nd num: "^n2^/c)
  688.                   sset @una(~n1~) n1=~unary~ @una(~n2~) n2=~unary~
  689.                   set unary=
  690.                   set c1=
  691.                   set c2=
  692.                   set mc=
  693.                   :loop1top
  694.                     :loop2top
  695.                       set mc=%mc%1
  696.                       echo Iterations through inner loop:  %mc%
  697.                       set c2=%c2%1
  698.                       if not !%c2%==!%n2% goto loop2top
  699.                     set c2=
  700.                     set c1=%c1%1
  701.                     if not !%c1%==!%n1% goto loop1top
  702.                   set c1=
  703.                   set c2=
  704.                   set n1=
  705.                   set n2=
  706.                   set mc=
  707.                   echo Done!
  708.  
  709.         20.  @UNI[(<dos directory>)]
  710.  
  711.              THIS FUNCTION ONLY WORKS IN DOS VERSIONS 3.0 AND GREATER.
  712.              Creates a 0-length file with a unique name and returns the
  713.              file name to the environment variable UNIQUE.  If a target
  714.              directory is not specified, the file will be created in the
  715.              root directory of the current disk.  This may be useful in
  716.              batch files which require the creation of temporary files.
  717.              As a demonstration, try keying in the following batch file:
  718.  
  719.  
  720.                                    12
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.                   @echo off
  728.                   sset @uni(dos)
  729.                   echo Now you see it, > %unique%
  730.                   type %unique%
  731.                   echo on
  732.                   dir %unique%
  733.                   @echo off
  734.                   del %unique%
  735.                   echo:
  736.                   echo Now you don't!
  737.                   echo on
  738.                   dir %unique%
  739.                   @echo off
  740.                   set unique=
  741.  
  742.         21.  @ZAP[(<variable>[^<variable>...][^/n])]│[(/n)]
  743.  
  744.              Erases all environment variables unless they are specifi-
  745.              cally listed as parameters.  Potentially dangerous, but very
  746.              useful for wholesale changes to the environment.  A warning
  747.              message is displayed and a confirmation prompt presented
  748.              when @ZAP is used, unless the "/n" parameter is given.  An
  749.              asterisk ("*") wild card is allowed at the end of each
  750.              <variable> (see item 2, above for more details regarding the
  751.              functioning of wild cards, and note that *= has the same ef-
  752.              fect as @ZAP(/n)).
  753.  
  754.              For example, to erase all environment variables except
  755.              COMSPEC, PATH, and PROMPT use
  756.  
  757.                   sset @zap(comspec^path^prompt)
  758.  
  759.              or, if you are sure other variables won't match the
  760.              wildcards, you might save some typing with something like:
  761.  
  762.                   sset @zap(co*^p*)
  763.  
  764.              See also:  <variable>=[<value>]
  765.  
  766.                                     MESSAGES
  767.  
  768.         SuperSET will generate an error message if there are syntax er-
  769.         rors in the command line, if there is no room left in the en-
  770.         vironment when an append is being attempted, when you are working
  771.         with the environment set up by a copy of COMMAND.COM and when the
  772.         file named in the @GET or @SAV functions can't be opened.  As the
  773.         latter function often precedes a @ZAP or some other drastic en-
  774.         vironment change, an error here terminates the program.  All of
  775.         these errors will set the DOS ERRORLEVEL to 255 when the program
  776.         exits, a value your batch files can test for.  Other messages,
  777.         regarding variable names not found in the environment, are
  778.         presented for information only, and do not set ERRORLEVEL.
  779.  
  780.                                    13
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.         Output from SuperSET may be redirected to a printer, a disk file,
  789.         or another DOS "device", or piped through a command like MORE
  790.         using the ">" and "|" characters respectively.  You will likely
  791.         want to use MORE if you've got a lengthy environment and you want
  792.         to examine it screen by screen.
  793.  
  794.         There is one occasion, in batch file operation, where it is es-
  795.         sential to use SET instead of SuperSET.  That is when environment
  796.         variables require setting in the middle of a "cascade" of ERROR-
  797.         LEVEL checks.  SuperSET, and any other program external to DOS,
  798.         resets the ERRORLEVEL to 0 on entry.
  799.  
  800.                              IMPORTANT DISTINCTIONS
  801.  
  802.         The DOS SET command affects the environment established only by
  803.         the most recently loaded copy of COMMAND.COM.  Many application
  804.         programs permit users to "shell out" to DOS, by running a second
  805.         instance (i.e., copy in memory) of COMMAND.COM.  Changes made
  806.         with SET to the shell environment disappear when the user types
  807.         EXIT.  If SuperSET is run on such occasions without the @BOT
  808.         function, it will affect the newly created environment (if suffi-
  809.         ciently large for the operations selected).  SuperSET issues a
  810.         warning message if you are working with a temporary environment.
  811.  
  812.         An interesting feature of the SET command (not incorporated into
  813.         SuperSET for a variety of reasons) is its ability to expand the
  814.         environment.  SET can only accomplish this by the addition of
  815.         strings beyond the "end" of the current environment and ONLY IF
  816.         no other programs (like TSRs) are sitting on top of the environ-
  817.         ment in memory.  Since the environment size for the first
  818.         (permanent) copy of COMMAND.COM is usually determined by the
  819.         SHELL statement in CONFIG.SYS, this is really only a problem with
  820.         temporary environments.  To compensate for SuperSET's deficiency
  821.         in this area, refer to the @FIL function, described above.
  822.  
  823.         SuperSET Version 1.61 is Copyright (c), 1991, by Richard Linley.
  824.         Please distribute it, in unaltered form and accompanied by this
  825.         help file, to anyone you like.  The program is presented "as is"
  826.         and guarantees nothing.  Watch for upgrades.  If you have sug-
  827.         gestions or requests for new features, please write to:
  828.  
  829.                                  Richard Linley
  830.                                  641 Sussex Blvd.
  831.                                  Kingston, Ontario
  832.                                  Canada
  833.                                  K7M 5A9
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.                                    14
  841.