home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 15 / CD_ASCQ_15_070894.iso / vrac / get261up.zip / GET26NEW.DOC < prev    next >
Text File  |  1994-03-08  |  45KB  |  917 lines

  1.  
  2.   GET26NEW.DOC - New features in GET.EXE 2.61 - Copyright 1994 Bob Stephan
  3.  
  4.   This file summarizes the new and improved features in GET.EXE Version
  5.   2.61. If you have been using an older version of GET, read this
  6.   file to find out what has been changed, and what has been added.  
  7.   GET 2.61 fixes a minor bug in GET 2.6 and adds an important note
  8.   below for GET K, Q, and L when run in an OS/2 DOS session!  See GET K.
  9.  
  10.   The file you obtained should be GET26UPD.ZIP.  It ia an upgrade
  11.   version of Bob Stephan's BATch Enhancer, GET.EXE, Version 2.61.  It 
  12.   is not authorized to be used except in conjunction with the documen-
  13.   tation included with the previous release, GET.EXE Version 2.5.  
  14.   All warranty and licensing provisions in the documention for Version
  15.   2.5 apply to Version 2.61 except as modified herein.  The new features
  16.   in this version were selected because they were requested by users.
  17.  
  18.   GET Version 2.61 is distributed as GET26.EXE so as to not inadvertently 
  19.   overwrite previous versions.  Rename GET26.EXE to GET.EXE when you are 
  20.   ready to replace older versions.
  21.  
  22.   Pricing, licensing, and copyright.
  23.   ---------------------------------------------------------------
  24.   GET 2.61 is released as shareware with a requested registration fee of 
  25.   $15 plus $1 shipping and handling to U.S.A, Canada, or Mexico, or $3
  26.   to other foreign countries. GET26UPD is released as an upgrade with no
  27.   manual included in the shareware package other than the information in
  28.   this file.  Registered license holders of GET 2.5 are eligible to receive 
  29.   a registered copy of the 2.61 upgrade FREE with an option to buy the 
  30.   full 2.61 manual for $6+S&H when available. The full manual which we
  31.   intend to have commercially printed can be included with new 
  32.   registrations for $6 or ordered later by registered users for $6 plus 
  33.   S&H as above.  These prices are subject to change.  Unfortunately, 
  34.   economics preclude us from continuing the free upgrade policy from
  35.   Version 2.61 and subsequent releases, but registered users will be 
  36.   able to obtain upgrades at very reasonable prices.  See ORDER.GET for 
  37.   additional pricing information.
  38.  
  39.   After the release date of Version 2.61, users sending in registrations
  40.   from the older versions still in circulation will receive both 2.5 
  41.   and 2.61 with documentation on disk, but no printed manual.  Read 
  42.   the file README.DOC before printing out the Version 2.5 manual.
  43.  
  44.   Information regarding the display of the Copyright notice:  We have 
  45.   attempted to make it so the notice will be displayed once and only 
  46.   once at the first call to GET after the computer is booted.  GET 
  47.   checks the Environment block to determine whether it has been run
  48.   prior to the current call.  If there is a GET= or a G$$= variable 
  49.   in the Environment, the copyright notice will not be displayed.  
  50.   If neither of these variables is present, GET will display the 
  51.   copyright notice, and then will create a G$$= variable to keep
  52.   itself from displaying the notice subsequently.
  53.  
  54.   You can avoid the creation of the G$$= variable by ensuring that 
  55.   there is always a GET= variable in the Environment whenever GET is 
  56.   called.  This is not always easy to control, however.  Note that a 
  57.   timeout for GET C /Wn or GET S /Wn will result in no value for the 
  58.   Environment variable.  This is also true for GET S and GET Z[E] if 
  59.   the string to be put in the Environment is empty such as when nothing 
  60.   but a return has been pressed.  The G$$= variable takes only 7 bytes 
  61.   of Environment space, so it is probably easier to just let GET create 
  62.   it rather than trying to ensure there is always a GET= present.
  63.  
  64.   The runtime version does not display the copyright notice unless
  65.   it is called with no valid arguments.  The runtime version for 
  66.   registered users is approximately 5K in size.
  67.  
  68.   New and modified features.
  69.   ---------------------------------------------------------------
  70.   The GET command information below is arranged alphabetically 
  71.   according to the GET command character. But first, a discussion
  72.   of new and changed switches and a few miscellaneous items.
  73.  
  74.   Switches.
  75.   -----------------------------------------------------------------
  76.   The #num syntax is eliminated along with the surrogates that have 
  77.     been replaced by the /X, /E, and /C switches.  #num and its ilk 
  78.     are all replaced with /Wnum.  The extended, enhanced, and break
  79.     surrogrates are all replaced with the switches that were intro-
  80.     duced in Version 2.5.  The older syntax was supported in 2.5 for
  81.     compatibility, but will no longer work in 2.61.
  82.  
  83.   $num indicates that num is in Hexadecimal if a number is expected.
  84.     This is useful for GET R and GET B, and can be used any place a 
  85.     numerical arg or parameter is expected.
  86.  
  87.   Now the # sign works as a prefix to an ASCII character and means use 
  88.     this character as a number.  Thus you can perform arithmetic using 
  89.     the numerical value of ASCII characters.  The # character, like the 
  90.     $ character for hex, can be used wherever numerical input is 
  91.     expected; however, with the # character only one character 
  92.     immediately following it is converted to the ASCII value of that 
  93.     character.  These conversions will be most useful with GET R.
  94.  
  95.   The /~ switch for GET S is being phased out, and replaced by /X (for 
  96.     Xcape).  The operation of GET S with the /X switch has been 
  97.     enhanced.  When /X is specified, if the user presses Escape, the 
  98.     Escape surrogate will be the result, and if the user presses Return 
  99.     (Enter) before pressing any other keys, the CR surrogate will be 
  100.     the result.  A timeout will produce a 0 (zero) result.  If /X is 
  101.     not specified, all three of these user actions will produce a 0 
  102.     result.
  103.  
  104.   /H provides a generalized Hexadecimal capability.  Whenever numerical 
  105.     output is expected in the Environment, /H will convert the output 
  106.     to Hexadecimal.  For GET F, /X will still report the full filesize 
  107.     in hex even if the errorlevel is in kilobytes (/A not being used), 
  108.     while /H will report kilobytes in hex unless /A is being used.
  109.  
  110.   /N is a new switch to suppress the carriage return after a prompt.
  111.     This works with any command that issues a prompt, including ECho
  112.     (GET EC).  Use with caution.  If the prompt is on the bottom
  113.     line of the screen and the /A switch is being used, DOS may pick
  114.     up the prompt attribute as the new screen attribute as it scrolls.
  115.     Various video BIOS's may produce different results.
  116.  
  117.   The /T (Trim) switch by itself (not /TR or /TL) will trim both left
  118.     and right.  You can also use /TB to trim both.  Trim will now also
  119.     trim Alt-255 characters (as upper case spaces).
  120.  
  121.   /R, a new switch, will force the Return Code into the Environment for
  122.     any GET command instead of the normal Environment result.
  123.  
  124.     EXAMPLE: Use GET to estimate the number of minutes it will take to 
  125.     transfer a file at different transmission speeds.  Since the /Wdiv 
  126.     switch for GET F only affects the ErrorLevel, we can use /R to put
  127.     the resulting value in the Environment also.  However, the divisor
  128.     would be too large at 9600 and 14400, so some preliminary math is 
  129.     used in the 9600 and 14400 calculations.  To keep it simpler, no
  130.     adjustments are made if the file is larger than 655360.
  131.  
  132.     @echo off
  133.     if "%1"=="" goto HELP
  134.     Rem Get file size in bytes, store in SIZE=
  135.     GET F %1 /VSIZE= /A 
  136.     if "%SIZE"=="" GOTO NOTFOUND
  137.     if "%SIZE%"=="*" GOTO TOOBIG
  138.     echo Minimum transfer time for a file size of %SIZE%
  139.     GET F %1 /r /w7200 /a
  140.     echo  at 1200 bps = %GET% minutes
  141.     GET F %1 /r /w14400 /a
  142.     echo  at 2400 bps = %GET% minutes
  143.     Rem Get file size in Kilobytes (*1024)
  144.     Rem SIZE/1060*60 ≈ SIZE/1024*62
  145.     GET F %1 /W62 /R
  146.     echo  at  9600 bps = %GET% minutes
  147.     Rem SIZE/1650*60 ≈ SIZE/1024*97
  148.     GET F %1 /W97 /R
  149.     echo  at 14400 bps = %GET% minutes
  150.     GOTO END
  151.     :NOTFOUND
  152.     Echo File %1 not found. 
  153.     GOTO HELP
  154.     :TOOBIG
  155.     Echo File %1 is too large.  Max size is 655360.
  156.     :HELP
  157.     Echo   The argument (%%1) is a file specification
  158.     Echo   bps = bits per second, cps = characters per second
  159.     Echo   for 12-2400, we use 10 bits / character (8 + start + stop)
  160.     Echo   for v.32, we est  8-9 bits / character
  161.     Echo   therefore
  162.     Echo      1200 bps = max of  120 cps
  163.     Echo      2400 bps = max of  240 cps
  164.     Echo      9600 bps = est of 1000-1100 cps, use est 1060
  165.     Echo     14400 bps = est of 1600-1700 cps, use est 1650
  166.     :END
  167.     SET SIZE=
  168.     SET GET=
  169.  
  170.  /S, a new switch for sound control, has been added.  For this
  171.    release, the only effective format is either /S or /S0 to turn
  172.    off the beeps for various alerts, such as striking an invalid
  173.    key, or getting a time-out.
  174.  
  175.  A revised method for locating the master environment for the /M 
  176.    switch has been implemented.  It is hoped that this will work in
  177.    those few instances where the old method failed.  Testing with
  178.    DESQview indicated that it would work with MS DOS but not with
  179.    DR DOS.  However, when it works, it finds the Environment for
  180.    the original command processor that loaded DESQview, not for 
  181.    any command processors running in the DV window.  It might 
  182.    work similarly with Windows, but it hasn't been tested.
  183.  
  184.   The maximum length of the input string for GET S and GET ZE has 
  185.     been increased from 79 to 127.
  186.  
  187.   /W is now defined to be the same as /W0.  This has implications for
  188.     functions such as C, S, N, W, and R.  See GET R below.
  189.  
  190.   When numerical input is used for an argument or with /W, the 
  191.     numbers can now be as large as 65535.  Previously they were 
  192.     limited to 4 digits.
  193.  
  194.   Miscellaneous features:
  195.   ---------------------------------------------------------------
  196.   All waiting periods should work for Windows DOS multitasking.
  197.    The DOS "idle interrupt" is called to permit multitasking in 
  198.    these environments.  It has always worked in DESQview and OS/2
  199.    DOS sessions.
  200.  
  201.   The help screen can exit at the --More-- pause.  It will time out in 
  202.    10 seconds and go to the next screen.  Press Esc to exit at this 
  203.    point, or any key except space, CR, or Esc to cancel the timeout.
  204.    PgUp can be used to return to the first screen and start over.
  205.  
  206.   If a value is too large for the division method used to convert it 
  207.     to an Environment variable, only a single asterisk will be stored 
  208.     as the Environment value instead of adding an asterisk to an 
  209.     invalid value.  The asterisk means that the value is larger than 
  210.     655,530.  Previously the values stored were not very meaningful, 
  211.     and the new method makes it easier to test for a large value.
  212.  
  213.   When a character argument (the arg not in double quotes) is called 
  214.     for, it can now be enclosed in single quotes ("'"s, apostrophes). To 
  215.     include a single quote in the argument, use two apostrophes next to 
  216.     each other.  There must always be an even number of quote symbols.  
  217.     '' by itself is the same as no argument at all.  To specify exactly 
  218.     one quote and nothing else use ''''.  Quoting permits including a space 
  219.     in the argument for GET C, for example.  Since you cannot test for a 
  220.     space with IF, if user enters space it will be reported as ASCII 
  221.     255 unless /L is used.  A quoted argument can be useful with GET # 
  222.     below. The single quote is usually on the same key with the 
  223.     double quote character, and should not be confused with the grave
  224.     accent or "back quote" character which is often on the same key
  225.     as the tilde.
  226.  
  227.     Also removed is the error message if a version of DOS less than
  228.     2.0 is detected.  This is considered to be a highly unlikely
  229.     event, so it will result in simply the "Invalid command" message.
  230.     Some features of Version 2.61 require DOS 3.0 or later.
  231.  
  232.     GET is sensitive to the number of spaces between GET and the
  233.     command character.  There must be one and only one space 
  234.     following GET.  This will be improved in a future release.
  235.  
  236.   GET COMMANDS in ASCII alphabetical order.
  237.  
  238.   GET #[E]                         Locate a substring in a string
  239.   ---------------------------------------------------------------
  240.     GET # is like the BASIC INSTR (In String) function.  It locates the
  241.     position of a substring within a string.  The syntax is:
  242.  
  243.     GET # "string" 'sub' [/Woffset] [/x] [/Trim]
  244.  
  245.     /x starts the search at the end of the string from right to left.  
  246.     The substring comparison is still left to right, and the position
  247.     reported is the offset from the beginning of the string.
  248.    
  249.     The result is 0 (zero) if the substring is not found in the 
  250.     string, else it is the location starting with 1 for the leftmost
  251.     character.  If no 'sub' is given, the length of string will be 
  252.     reported.  If /Woffset is specified, the search will begin at the
  253.     offset specified; thus, a second or subsequent occurrence can be
  254.     found.  If /x is specified, the offset is counted from right to
  255.     left.  The search is case sensitive.
  256.  
  257.     Notes: for GET # you cannot include the single quote character 
  258.     (apostrophe) in the substring.  
  259.  
  260.     Examples: Command                            Result
  261.     GET # "D:\subdir\filename.ext" '\'             3
  262.     GET # "D:\subdir\filename.ext" '\' /w3        10
  263.     GET # "D:\subdir\filename.ext" '\' /x         10
  264.     GET # "D:\subdir\filename.ext" '\' /x/w10     10
  265.     GET # "D:\subdir\filename.ext" '\' /x/w13      3
  266.  
  267.   GET #E uses the GET # arguments to Extract the string.
  268.     After skipping /Wn characters, the substring up to but not 
  269.     including 'arg' will be extracted.  The ErrorLevel is the length
  270.     of the extracted substring.
  271.  
  272.     If /X is specified, the substring in 'arg' plus everything to the
  273.     right except the first character  will be extracted.  On the 
  274.     basis that it is easier in BATch files to catenate strings rather 
  275.     than shorten them, the first character of the target string is 
  276.     likely to be a delimiter of some sort, for example the '\' in a 
  277.     filespec, or the white space between words.  The below 
  278.     examples demonstrate how easy it is to extract portions of a 
  279.     filespec.
  280.  
  281.     Examples: Command                            Result            ErrorLevel
  282.     GET #E "D:\subdir\filename.ext" ':'          D                      1
  283.     GET #E "D:\subdir\filename.ext" '\'          D:                     2
  284.     GET #E "D:\subdir\filename.ext" '\' /w3      subdir                 6
  285.     GET #E "D:\subdir\filename.ext" '\' /x       filename.ext          12
  286.     GET #E "D:\subdir\filename.ext" '.' /x       ext                    3
  287.     GET #E "D:\subdir\filename.ext" '\' /x/w10   filename.ext          12
  288.     GET #E "D:\subdir\filename.ext" '\' /x/w13   subdir\filename.ext   19
  289.  
  290.     Note:  There may be a confusing difference between the use of /Wn 
  291.     for GET Z[E] and GET #E.  For GET Z /Wn specifies the maximum width.
  292.     For GET # /Wn specifies the offset to start the extraction.  In 
  293.     retrospect it would seem to be better to reverse the meaning of 'arg" 
  294.     and /W for GET Z[E], but this would make it incompatible with the
  295.     previous release.
  296.  
  297.     The /T trim switches can be used to trim blanks and Alt-255 
  298.     characters from either or both ends of the extracted string.
  299.  
  300.  
  301.   GET 4, GET DV                        4DOS and DESQview Versions
  302.   ---------------------------------------------------------------
  303.   DESQview and 4DOS Version numbers.  GET DV reports the DESQview 
  304.     Version number if it is running, otherwise 0.  GET 4 reports
  305.     the 4DOS Version number if it is running, otherwise 0.  The 
  306.     4DOS Version number only indicates that 4DOS is in memory, not
  307.     necessarily that it is the parent of the BATch program, but you
  308.     can check for that with the test given in the 4DOS manual:
  309.       if not "%_cwd%"=="" echo 4DOS is loaded!
  310.  
  311.   GET AE                                           ROM BIOS Model
  312.   ---------------------------------------------------------------
  313.   GET AE returns additional information in the Environment.  In 
  314.     addition to the 2-byte machine code, there is a space, then the
  315.     8-byte BIOS date.
  316.  
  317.   GET B                              Blank Screen [using a color]
  318.   ---------------------------------------------------------------
  319.   GET B can now use the same attributes with /A that the prompt uses.
  320.     The /W switch can be used with GET B to set the number of roWs 
  321.     on the screen for EGA or VGA monitors.  GET B /W25 sets the
  322.     screen to 25 line mode.  GET B /W43 sets EGA screens to 43 line
  323.     mode, and VGA screens to 50 line mode.  If the /X switch is used,
  324.     GET B will return the current number of lines on the screen 
  325.     instead of the video attribute.  This is done by using a BIOS
  326.     call to load either the default 8x14 or 8x8 font table.  Your
  327.     number of lines may vary depending on your EGA or VGA BIOS. To
  328.     get 25 line mode, it may work better to use GET V 3 to set video
  329.     mode 3 instead of GET B /W25.
  330.  
  331.     GET BE will still work the same, and the number will be taken to 
  332.     be in hex whether it has a $ or not with the Environment value in
  333.     hex.  GET B can take a $hex number as input but will report in decimal 
  334.     unless /H is used.
  335.  
  336.   GET D                                               DOS Version
  337.   ---------------------------------------------------------------
  338.   GET D now puts 20 in the Environment for OS/2 major version.  Also,
  339.   GET DE will put a 2 digit minor in Environment (but not in ErrorLevel).
  340.  
  341.   GET E                                         Environment Space
  342.   ---------------------------------------------------------------
  343.   Information about the Environment space with GET E has been enhanced 
  344.    to provide the full size as an eXtra function with /X.  GET E or 
  345.    GET EE with the /X switch will report the total bytes in the 
  346.    command processors Environment.  If you are running under a 
  347.    secondary command processor, GET E or GET EE with the /M switch 
  348.    will report Environment information for the master Environment.
  349.  
  350.    One way to use this information is to be able to enlarge the 
  351.    Environment space available if GET E reports too little to do what 
  352.    you want to do.  For example, suppose you need 100 bytes of 
  353.    Environement free, but GET E tells you there are only 50 bytes 
  354.    available.  You can then find the total size of the Environment, 
  355.    and recursively invoke the command processor with the new size
  356.    that you will need after finding out how big it was originally.
  357.    
  358.    EXAMPLE: You need 100 bytes of Environment free:
  359.  
  360.    GET E
  361.    Rem First time GET reports ErrorLevel : 50
  362.    Rem Then the second time through with enough space branch to CONTINUE
  363.    IF ErrorLevel 100 goto CONTINUE
  364.    GET E /X
  365.    Rem Check for error to prevent infinite loop.
  366.    IF not ErrorLevel 1 GOTO END
  367.    Rem Add 112 bytes to original Env size. (use a multiple of 16).
  368.    GET R "+" %GET% /W112
  369.    Rem Invoke a new command processor with increased Env and run BAT file.
  370.    %COMSPEC% /E:%GET% /C%0 %1 %2 %3 %4 %5
  371.    Rem When the secondary command processor terminates, it will have
  372.    Rem   run this BATch file, so now we must exit.
  373.    GOTO END
  374.    :CONTINUE
  375.    Rem Do your thing here.
  376.    :END
  377.  
  378.   A subtle change in the operation of GET E that may be useful.  
  379.     Previously, it did not remove the GET variable from the 
  380.     Environment before measuring the space remaining, even though it
  381.     overwrote it later with the new GET variable.  Now it will 
  382.     remove the GET or other variable specified with /V for GET E 
  383.     before measuring.  That gives a better measure of how much space 
  384.     is available for GET variables.  To make it work as it did before, 
  385.     just specify a variable that is not already in the Environment 
  386.     with the /V switch. As usual, /V- will suppress any changes to
  387.     the Environment.
  388.  
  389.     For the old method it would have been necessary to call GET twice
  390.     or remove any existing GET variable from the environment with 
  391.     SET GET= to get a more accurate measure of the Environment space
  392.     available for GET to work in.  To provide for sufficient free
  393.     Environment space in the event the BATch file is being run from
  394.     a "shell" you can now SET GET=(a large variable) in your AUTOEXEC or 
  395.     before loading the shell (PC Shell, Xtree, etc.), and when GET 
  396.     measures the environment it will clear out the GET variable and 
  397.     give you an accurate reading.
  398.  
  399.   GET EC                                    Echo [with attribute]
  400.   ---------------------------------------------------------------
  401.   An "echo" feature was added.  This can be effected by calling GET EC
  402.     with a "prompt" such as: GET EC "Hello".
  403.     The advantages to using this instead of GET I "Hello" for example,
  404.     are that the echo feature can be redirected. The ending carriage
  405.     return can be suppressed with /N.  If you want to Echo a printer
  406.     command, for example, you can do it with GET EC "Esc command">PRN /N.
  407.     An ANSI.SYS command can be echoed with GET EC "Esc command" /N
  408.  
  409.   GET F                                    File Size or Date/Time
  410.   ---------------------------------------------------------------
  411.   GET F can now return the File DATE and/or TIME. This feature has
  412.     been requested by quite a few users so was added to this release at
  413.     the last minute. The syntax is:
  414.  
  415.     GET F[E] filename /E [/Wn]
  416.  
  417.     The /E switch specifies that GET F return the date instead of the
  418.     file size.  The number n in /Wn uses the same coding as GET H to 
  419.     return the date/time information; i.e. 2=Day of the Month, 4=Month,
  420.     8=Year, 16=Minute, and 32=Hour. These are the only valid codes.
  421.     The default is 2 for Day of the month. In other respects,
  422.     GET F[E] /E works the same as GET H[E] for reporting the date 
  423.     information, and the format will be the same as for system date/
  424.     time information as reported by GET H.  International date/time
  425.     formats have not been implemented in this version, but will be in
  426.     a future version.
  427.  
  428.     NOTES: Previously GET F /E worked the same as GET F /X.  This has
  429.     been changed and any BATch programs that used GET F /E must be
  430.     changed to use GET F /X instead.
  431.  
  432.     GET F does not open a subdirectory as a file and therefore cannot 
  433.     obtain the date of a subdirectory.  For GET F ... /E, if the filespec
  434.     is a subdirectory, the ErrorLevel will be 0 and the Environment variable
  435.     will be empty.  Root directories will probably return the same 
  436.     result, but see information on root directories below.
  437.  
  438.     GET F filespec /A is for small files and reports the full size in the
  439.     Environment, and in the ErrorLevel (max 255) unless reduced by /Wdiv.
  440.  
  441.     For GET F, /X will still report the full filesize in hex even if
  442.     the errorlevel is in kilobytes (/A not being used), while
  443.     /H will report kilobytes in hex unless /A is being used.  Sorry 
  444.     if this is a bit confusing.
  445.  
  446.     GET F must open the file for reading in order to obtain the 
  447.     requested information.  This means that GET F may fail on files 
  448.     that cannot be opened in this manner.  Although special handling 
  449.     is implemented for directories (which GET cannot open as files), 
  450.     there are other cases where GET may return the code 5 meaning 
  451.     "Access denied".  Such cases include, but may not be limited to
  452.     files on network drives for which read access has not been 
  453.     granted, files opened by other processes, volume label names, and 
  454.     possibly root directories in older versions of DOS.  The 
  455.     following return codes are of particular interest for GET F.
  456.         2 for "File not found"
  457.         3 for "Path not found" (this may also be returned for an
  458.                                 invalid drive specification).
  459.         5 for "Access denied"
  460.        15 for "Invalid drive"
  461.  
  462.   GET F will accept a root directory specification and treat it the 
  463.     same as a subdirectory by reporting an ErrorLevel of 0 and setting 
  464.     the Environment variable to 0 also.  However, since the root 
  465.     directory is not a file, the result may be dependent on the version 
  466.     of DOS.  It has only been tested with MS-DOS 5.0 and may work 
  467.     differently on older versions of DOS.  If your application may 
  468.     sometimes use GET F for a root directory, test it with all versions 
  469.     of DOS that it may encounter to determine the results that will be 
  470.     reported.  If an invalid drive is specified in the filespec, the
  471.     ErrorLevel will probably be 3 (path not found) and the Environment 
  472.     variable will be empty.  Remember that GET F does not check for a
  473.     valid disk in the drive, so if you are checking A: or B: and 
  474.     there is a chance that there may not be a formatted diskette in 
  475.     the drive, use GET K, Q, or L first to verify it.  Checking for
  476.     a formatted diskette each time would slow GET F down with the
  477.     extra overhead which is unnecessary in most cases.
  478.  
  479.     GET F will also accept the \ as the last character of the filespec if 
  480.     it is a directory.  A trailing \ will be ignored, so it doesn't 
  481.     necessarily specify a directory. For a root directory, the \ is
  482.     required.
  483.  
  484.   GET H                                      System Date and Time 
  485.   ---------------------------------------------------------------
  486.   GET HE has been changed to display a 4-digit year if code 8 is 
  487.     included in the argument.  This permits years later than 1999 to 
  488.     be reported and used.   Note: 4DOS Version 3.xx DATE command will 
  489.     not accept a 4-digit year.  4DOS Version 4+ works OK.
  490.     The ErrorLevel for Year is Year-1900, thus 2000 will be 100, etc.
  491.  
  492.     The code 256 was added to specify the result to be 100ths of seconds 
  493.     Codes 128 and 256 work only with GET H, not GET HE.  Also remember
  494.     that code 128 is the only one that can be combined with another 
  495.     code for GET H since GET H returns a single result.
  496.  
  497.     GET HE now will check for a /A switch, and if found will not
  498.     substitute a leading blank for a leading 0.
  499.  
  500.     EXAMPLE: Display the Day of The Week for any date between 
  501.     1-1-1980 and 12-31-2099, then reset the current date.
  502.  
  503.     @echo off
  504.     set TRY=%1
  505.     if not "%1"=="" goto TryDate
  506.     get s "Enter mm-dd-yyyy: " 99-99-9999 /VTRY=
  507.     :TryDate
  508.     GET HE 14 /vDAY=
  509.     date %TRY%
  510.     GET H 1
  511.     date %DAY%
  512.     goto DAY%GET%
  513.     :DAY6
  514.     set DOW=Satur
  515.     goto END
  516.     :DAY5
  517.     set DOW=Fri
  518.     goto END
  519.     :DAY4
  520.     set DOW=Thurs
  521.     goto END
  522.     :DAY3
  523.     set DOW=Wednes
  524.     goto END
  525.     :DAY2
  526.     set DOW=Tues
  527.     goto END
  528.     :DAY1
  529.     set DOW=Mon
  530.     goto END
  531.     :DAY0
  532.     set DOW=Sun
  533.     :END
  534.     Echo Day of the week for %TRY%: %DOW%day
  535.     :EXIT
  536.     Set TRY=
  537.     Set DAY=
  538.     Set DOW=
  539.     Set GET=
  540.     
  541.   New waiting time features in GET H!
  542.   GET H (Horological) /W option revised.
  543.  
  544.    /Wnum now means wait for the given number of seconds, then report.
  545.    /X/Wnum means wait until a minute in 24 hour time, then report.
  546.      NOTE: The 24 hour time specification must be in military format,
  547.      no punctuation; e.g., 1135, 0300, 1056, etc.  Use 2400 for 
  548.      midnight, not 0000.
  549.    
  550.   In either case the wait cannot be longer than 18 hours (65535 
  551.     seconds).  If the 24 hour time is longer than 18 hours hence,
  552.     it will be reduced to 18 hours.  If a number of seconds greater 
  553.     than /W65535 is specified, the results are unpredictable.  If the 
  554.     24 hour time specification is less than the current time, it will
  555.     be interpreted as meaning going past midnight to the given time 
  556.     on the next day.  Internally GET C is used to process the waiting 
  557.     time, thus the wait can be interrupted by pressing any key.  If a 
  558.     "prompt" is included, it will be displayed during the wait.  Any 
  559.     switches will be used for GET C also, thus /A can be used to 
  560.     control the attribute of the prompt.  However, no character 'arg' 
  561.     will be recognized, so any key will interrupt the wait.
  562.  
  563.   Although it was possible to accomplish the same thing with GET C /W 
  564.    in previous versions, this feature will make it easier and more 
  565.    precise to specify waiting times in BATch files.  If necessary to 
  566.    wait more than 18 hours, more than 1 call to GET can be used to wait 
  567.    various lengths of time, each no more than 18 hours.
  568.    
  569.   EXAMPLES:
  570.    1. Wait until 11:30 p.m. the same day.
  571.  
  572.    GET HE "Waiting until 2330" 112 /x /w2330
  573.    Rem the prompt is displayed while waiting.
  574.    Rem Waiting until 2330
  575.    REM After the appropriate wait the results of GET HE 112.
  576.    The Environment is: 23:30:00
  577.    The ErrorLevel is: 8
  578.  
  579.    2. Wait until 3 a.m. the next day (or the same day if after midnight)
  580.  
  581.    GET HE 112 /x /w300
  582.    The Environment is: 03:00:00
  583.    The ErrorLevel is: 8
  584.  
  585.    3. Wait for 3600 seconds (1 hour).  Starting time: 11:30 a.m.
  586.    
  587.    GET HE 112 /w3600
  588.    The Environment is: 12:30:00
  589.    The ErrorLevel is: 8
  590.  
  591.   GET K,  GET L,  GET Q                      Disk Space and Label
  592.   ---------------------------------------------------------------
  593.   Commands GET K, Q, and L have been modified to use a different procedure 
  594.     to check for a formatted floppy disk in a drive.  This procedure is 
  595.     much faster if there is a disk in the drive that is not formatted.  
  596.     As before, if it cannot be determined if a formatted disk is in the 
  597.     drive, the ErrorLevel will be 0, and an error code will be in the 
  598.     Environment. The error codes that will probably be returned may be 
  599.     different than previous versions of GET as follows (in hexadecimal):
  600.  
  601.     1  Invalid drive specified - this new procedure works only for 
  602.        drives on the primary disk controller, usually A: and B:.
  603.     2  Address mark not found meaning disk is not formatted
  604.     6  Floppy disk has been removed.  If this code is returned, try 
  605.        again since it may persist even if the drive door has been
  606.        opened and closed again, especially if a disk cache is in use.
  607.    20  Controller failed meaning disk is not formatted.
  608.    80  Drive timed out probably because door is open
  609.  
  610.   Other codes that may be seen - test on your system:
  611.     3  disk write protected may mean no diskette in drive.
  612.     4  sector not found - possible if disk is not formatted.
  613.     8 and 9  DMA errors (unlikely)
  614.     C  media type not found - possible if disk is not formatted.
  615.    10  data error - formatted disk in drive but is unreadable
  616.    40  seek failed (unlikely) .
  617.    NOTE: A bug in the initial release of version 2.6 reported an error
  618.    code of 180 instead of 80 in some cases.  This has been fixed in 2.61.
  619.    Also the above codes were previously given in decimal but are reported
  620.    in hex, so the above documentation has been changed to the hex values.
  621.  
  622.    IMPORTANT NOTE: It has recently been discovered that these functions 
  623.    have had to be changed to work differently when run in an OS/2 DOS 
  624.    session.  Because of an incompatibility with the new, faster method
  625.    we have had to restore the old method of Version 2.5 when it is
  626.    detected that GET 2.61 is being run in an OS/2 DOS session.  This 
  627.    also means that the error codes reported will be those documented
  628.    for Version 2.5 vice the above.
  629.  
  630.   GET P                                            Printer Status
  631.   ---------------------------------------------------------------
  632.   Customized printer status tests.  GET P[E] will accept a
  633.     numerical arg representing a byte value.  This value will be
  634.     "and"ed with the printer status byte, and the result returned
  635.     in the ErrorLevel and the Environment.  If a numerical arg is 
  636.     present GET PE will not affect the status of PrtSC, but it
  637.     will still attempt to initialize the printer.  Note that if you
  638.     are using a print spooler or buffer, all bets are off.  Everything
  639.     depends on what is returned in response to Int 17h, Service 02.
  640.    
  641.     Printer status items that can be tested for.  Sum the values to 
  642.     test for the items desired.
  643.        Value Hex     Item
  644.          1    $1   Time-out
  645.          8    $8   I/O Error
  646.         16   $10   Printer selected
  647.         32   $20   Out-of-paper signal
  648.         64   $40   Acknowledgement from printer
  649.        128   $80   Printer not busy (0 means busy)
  650.  
  651.     For GET PE only, the /X switch will force disabling of PrtSc 
  652.     whether a printer is attached or not.
  653.     
  654.     EXAMPLES: 
  655.     1. GET P 255 will return a value representing the sum
  656.     of the values of all 1-bits in the printer status byte.
  657.  
  658.     2. GET P 144 will indicate with either 0 or 144 whether the 
  659.     printer is available and ready for data.
  660.  
  661.     3. Disable Shift-PrtSc:
  662.        GET PE /X
  663.        Enable Shift-PrtSc again but only if the PE test is 1:
  664.        GET PE
  665.  
  666.   GET R                                                'Rithmetic
  667.   ---------------------------------------------------------------
  668.   GET R ('Rithmetic) has the following new features.  The arithmetic 
  669.     symbol must be entered as the "prompt" argument.
  670.  
  671.     Syntax:  GET R ["+-*/!="] [num1] [/Wnum2] [/H]
  672.              The defaults for num1 and num2 are 0 (zero).
  673.              /H reports the final Environment result in Hexadecimal
  674.     Symbols: "+"  the default, adds the two numbers.
  675.              "-"  subtracts num2 from num1
  676.              "*"  multiplies the two numbers.  The maximum product is
  677.                   655,350.  If the multiplication produces a larger 
  678.                   product an asterisk will be used to
  679.                   indicate that the result is too large.
  680.                   Note num2 defaults to 0, so if it
  681.                   is not specified, the result will be 0.
  682.              "/"  divides num1 by num2 by integer arithmetic.  Only
  683.                   the quotient is returned.  See NOTE below.
  684.              "!"  modulo arithmetic.  Divides num1 by num2 and returns
  685.                   only the remainder.
  686.          NOTE:    Division by zero is invalid.  If num2 is omitted,
  687.                   or is 0, the result will be num1 for "/" or "!".
  688.                   If num1>255 the result will be num1 modulo 256.
  689.              "="  compares num1 and num2 and returns one of:
  690.                   0 if num1<num2
  691.                   1 if num1=num2
  692.                   2 if num1>num2.
  693.                   This makes it easy to use ErrorLevel to check for
  694.                   >= or <= as well as one of the above.
  695.  
  696.     When numerical input is used for an argument or with /W, the 
  697.     numbers can now be as large as 65535.  Previously they were 
  698.     limited to 4 digits.
  699.  
  700.     $num indicates that num is in Hexadecimal if a number is expected.
  701.     This is useful for GET R, GET B, and can be used anyplace a 
  702.     numerical arg or parameter is expected.
  703.  
  704.     Now the # sign works as a prefix to an ASCII character and means use 
  705.     this character as a number.  Thus you can perform arithmetic using 
  706.     the numerical value of ASCII characters.  The # character, like the 
  707.     $ character for hex, can be used wherever numerical input is 
  708.     expected; however, with the # character only one character 
  709.     immediately following it is converted to the ASCII value of that 
  710.     character.  These conversions will be most useful with GET R. GET R 
  711.  
  712.     /H provides a generalized Hexadecimal capability.  Whenever 
  713.     numerical output is expected in the Environment, /H will convert
  714.     the output to Hexadecimal. 
  715.  
  716.     The /A (for ASCII) switch in the case of GET R, means put the 
  717.     ErrorLevel in the Environment as an ASCII character.
  718.  
  719.     EXAMPLES: 
  720.     1. Convert a hexadecimal number to decimal
  721.     GET R $ABC
  722.     The Environment is: 2748
  723.     The ErrorLevel is: 188
  724.     NOTE: Since the ErrorLevel is limited to a max of 255, the result
  725.     is reported modulo 256.
  726.  
  727.     2. Add a hexadecimal number to a decimal number
  728.     GET R 10 /W$A
  729.     The Environment is: 20
  730.     The ErrorLevel is: 20
  731.  
  732.     3. Add a hexadecimal number to a decimal number, result in hex
  733.     GET R 10 /W$A /h
  734.     The Environment is: 14
  735.     The ErrorLevel is: 20
  736.  
  737.     4. You want a single digit for the month to use in 
  738.     constructing a filename.  Suppose the month is December.
  739.  
  740.     GET H 4 /H
  741.     The Environment is: C
  742.     The ErrorLevel is: 12
  743.  
  744.     5. Suppose you want a series of characters A, B, C, D, E to 
  745.     construct 5 filenames.  With the new methods only one call to
  746.     GET within the loop is necessary.
  747.  
  748.     Rem Establish starting point of first character - 1.
  749.     GET R "-" #A /W1 /VC= /A
  750.     Rem Convert the value for the last character.
  751.     GET R #E /VN=
  752.     :NAMELOOP
  753.     Rem Convert last char to num, add 1, and convert back to char.
  754.     GET R "+" #%C% /W1 /VC= /A
  755.     Echo Character %C% can be used in a name.
  756.     IF NOT ERRORLEVEL %N% GOTO NAMELOOP
  757.     SET C=
  758.     SET N=
  759.  
  760.     6. Convert a hexadecimal number to an ASCII Character
  761.     GET R $4F /A        
  762.     The Environment is: O
  763.     The ErrorLevel is: 79
  764.  
  765.     7. Add a hexadecimal number to an ASCII Character, and convert
  766.     the result to an ASCII character.
  767.     GET R #A /W$A /A
  768.     The Environment is: K
  769.     The ErrorLevel is: 75
  770.     
  771.     8. Add a hexadecimal number to an ASCII Character, result in hex
  772.     GET R #A /W$20 /h
  773.     The Environment is: 61
  774.     The ErrorLevel is: 97
  775.  
  776.   GET S                                                Get String
  777.   ---------------------------------------------------------------
  778.   GET S has additional Exit key features.
  779.  
  780.     When /X is specified, if the user presses Escape, the Escape 
  781.     surrogate will be the result, and if the user presses Return (Enter) 
  782.     before pressing any other keys, the CR surrogate will be the result.  
  783.     A timeout will produce a 0 (zero) result.  If /X is not specified, 
  784.     all three of these user actions will produce a 0 result.
  785.  
  786.     /E turns on function keys as Exit keys.  If the user presses
  787.     a function key (F1-F10 only), and if /E is specified, then the
  788.     surrogate code (100+scan code) for that function key will be 
  789.     reported.  /E includes /X, so both are not needed.  /E does not 
  790.     turn on Enhanced keys in this case, it only enables F1-F10.  
  791.     This permits something like "F1 for help" to be used.
  792.  
  793.   The /~ switch for GET S is being phased out, and replaced by /X (for 
  794.     Xcape).  If used with GET?=ON a warning will be displayed.
  795.  
  796.   The maximum length of the input string for GET S and GET ZE has 
  797.     been increased from 79 to 127.
  798.  
  799.   GET W                                            Warm/Cold Boot
  800.   ---------------------------------------------------------------
  801.   GET W will now take a prompt.  If a "prompt" is specified, the code 
  802.     for GET C is called to wait for a character to be entered.  The 
  803.     switches for GET C including /W, /C, and /A can be used.  If /C is 
  804.     not specified the user can break out with Ctrl-Break or Ctrl-C.  
  805.     To prevent this, use /C.  When a valid character is entered, the
  806.     specified type of reboot will be initiated.  Using a prompt 
  807.     nullifies the effect of an argument which modifies GET W to just
  808.     try to determine whether the last boot was warm or cold.  As with
  809.     GET C, if an invalid character is entered, the waiting time will
  810.     be infinite.
  811.  
  812.   GET X                     Return Code from Execution of Program
  813.   ---------------------------------------------------------------
  814.   GET X provides a method of getting the return code (ErrorLevel) from 
  815.     a program into the Environment.  The syntax is:
  816.    
  817.     GET X "d:\path\program.ext" ' progargs' [/switches]
  818.  
  819.     where "program" is the name of the program you want to run.  It 
  820.     must be fully qualified with drive, path, and extension of either 
  821.     .COM or .EXE (no BATch files).  The exceptions are if the program 
  822.     is on the current drive, or in the current directory, in which 
  823.     cases drive and\or directory will default to current.  Do not 
  824.     include any spaces inside the double quotes.  You can use .. for 
  825.     the parent directory of the current subdirectory, and . for the 
  826.     current directory, however the latter is not needed since it will 
  827.     default to the current directory.
  828.  
  829.     ' progargs' are the arguments, parameters, and switches for the 
  830.     program you want to run.  Many programs require that the first 
  831.     character in the "command tail" be a space, so it is good practice
  832.     to start the argument string with a space.  It is also good 
  833.     practice to enclose the progargs in single quotes, however if no
  834.     spaces are included, the quotes are not absolutely necessary.
  835.  
  836.     [/switches] are the optional switches for GET, such as /M for the
  837.     master environment, or /V to designate the variable name.  Any 
  838.     switches for the program must be included in progargs.
  839.  
  840.     If GET X is successfull in loading and running the designated 
  841.     program, the ErrorLevel from the program will be in both the 
  842.     Environment and the ErrorLevel when GET terminates.
  843.  
  844.     If GET X is not successful, the Environment variable will be 
  845.     empty, and the ErrorLevel will contain a reason for the failure:
  846.        2 File not found - check the file specifications.
  847.        3 Path not found - check the drive and path information
  848.        4 Too many open files
  849.        5 Access denied - check for proper .COM or .EXE extension
  850.        8 Not enough memory
  851.  
  852.     If the "child" program terminates abnormally, there will be no 
  853.     Environment variable, and the ErrorLevel will be one of the 
  854.     following:
  855.        21  Child program was terminated by Ctrl-C or Ctrl-Break.
  856.        22  Critical device error - e.g. answering "a" to "Abort, 
  857.            Retry, Fail".
  858.        23  Child program stayed resident as a TSR.  This should never 
  859.            happen because you should not load a TSR in this manner.
  860.  
  861.   GET XE places the eXecution path of GET.EXE in the Environment,
  862.     including the drive, path, name, and extension of the file and
  863.     location from which GET is executing.  The ErrorLevel will be the
  864.     ASCII code of the drive; e.g. 65 for A, 66 for B, etc.  This can
  865.     be useful on an installation disk to determine the drive from
  866.     which the installation program is running.  Requires DOS 3+.
  867.  
  868.  
  869.   GET Z                          Zap (Additional String Handling)
  870.   ---------------------------------------------------------------
  871.   GET Z.  The syntax is:
  872.  
  873.      GET Z[E] "string" [skip] [/X] [/Wn] [/other switches]
  874.  
  875.       The <skip> argument works for GET ZE as well as GET Z.
  876.     /X with GET Z[E] now means to begin the operation at the right
  877.     end of the string.  In order to extract anything when using /X
  878.     there must be a skip argument.  The skip arg skips from right 
  879.     to left, and the /Wn takes n chars from that position to the
  880.     RIGHT.  If the /Wn is omitted, everything to the right of the
  881.     starting position set by skip will be extracted.
  882.  
  883.       GET ZE works the same as GET Z now, except for the
  884.     source of the string.  Z takes the string from the "string" arg,
  885.     and GET ZE takes the string from standard input.
  886.     NOTE: You can save the length of a string as an environment
  887.     variable with GET # above, or with GET Z with /R (see above).
  888.  
  889.     EXAMPLE: Extract the minutes and seconds from the DOS TIME 
  890.              command.
  891.     GET U 13
  892.     TIME >TIME.DOS
  893.     GET ZE 22 /W5 <TIME.DOS >NUL
  894.     NOTE: This is not a reliable method if any users might be using
  895.     DR DOS or 4DOS which have a different format for TIME and DATE.
  896.  
  897.   If you use GET Z or ZE with /W1 to extract a single character, the 
  898.     ASCII decimal value of the character will be in the ErrorLevel (or 
  899.     0 if the extraction failed).  Previously GET dutifully reported an 
  900.     ErrorLevel of 1 meaning that you extracted one character, but you 
  901.     already knew that so it wasn't very useful.  Reporting the value of 
  902.     the character provides additional information, and may save another 
  903.     call to GET to make that determination.
  904.  
  905.     Furthermore, for GET Z only, if both /W1 and /A (for ASCII) are 
  906.     specified, the ASCII decimal value will be spelled out in the
  907.     Environment also.  This allows it to be available to another BATch
  908.     command, or another GET command such as GET R.  If the extraction 
  909.     fails such as because the string is empty, or you skip too far, 
  910.     then the Environment variable will still be expunged.
  911.   -----------------------------------------------------------------------
  912.     If you have any questions, comments, or suggestions please contact us:
  913.         MOBY DISK: 1021 San Carlos Road, Pebble Beach, CA 93953
  914.     Phone: (408) 646-1899     COMPUSERVE:72357,2276      Prodigy: FNGC05A
  915.     Internet: bob.stephan@nitelog.com            BBS: Nitelog 408-655-1096
  916.     BBS: The Cricket 408-373-3773       /s/ Bob Stephan  February 11, 1994
  917.