home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 17 / CD_ASCQ_17_101194.iso / vrac / input321.zip / INPUT.DOC < prev    next >
Text File  |  1994-08-08  |  25KB  |  606 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.         
  8.                             
  9.                             
  10.                             
  11.                             
  12.                             
  13.                             
  14.                             
  15.                             
  16.                             
  17.                             
  18.                             
  19.                             
  20.                             
  21.                             
  22.                             
  23.                             
  24.                                STEENBURGH'S STUFF
  25.                             Mildly Useful Utilities
  26.                                 For Batch Files
  27.                                  Version  3.0
  28.           Copyright 1991-1993 by Chuck Steenburgh and Tay-Jee Software
  29.         
  30.                              _______
  31.                         ____|__     |               (TM)
  32.                      --|       |    |-------------------
  33.                        |   ____|__  |  Association of
  34.                        |  |       |_|  Shareware
  35.                        |__|   o   |    Professionals
  36.                      -----|   |   |---------------------
  37.                           |___|___|    MEMBER
  38.         
  39.         
  40.         
  41.         
  42.         
  43.         
  44.         
  45.         
  46.         
  47.         
  48.         
  49.         
  50.         
  51.         
  52.         
  53.         
  54.         
  55.  
  56.                                      Page 1
  57.  
  58.  
  59.  
  60.  
  61.  
  62.         
  63.         
  64.         
  65.         
  66.         
  67.         
  68.         INPUT v3.21                                                     |
  69.         Copyright 1991-1994 Chuck Steenburgh & Tay-Jee Software
  70.         
  71.            If you use batch files very often, you've probably acquired
  72.         a program called ASK.COM or QUERY.COM or something similar 
  73.         that allows you to ask questions and receive simple responses.
  74.         Usually, this involves typing an ECHO command with your
  75.         question, followed by ASK.COM or whatever.  If you do this
  76.         a lot, you will probably appreciate the fact the INPUT.EXE
  77.         will accomplish the jobs of both the ECHO and ASK commands.
  78.         Add to this the greater flexibility that INPUT.EXE offers
  79.         in presenting your prompt to the user and in receiving input,
  80.         and you'll be sold.
  81.         
  82.         Usage: INPUT ["prompt"] [nnn] [Options]
  83.                      
  84.         
  85.                   "prompt"        Enter the text you would like to
  86.                                   appear to prompt the user for
  87.                                   input.  This can be up to 59 char-
  88.                                   acters and must be enclosed in
  89.                                   quotation marks.
  90.         
  91.                   nnn             Enter a number representing the   
  92.                                   color in which you want your mes-
  93.                                   sage to appear.  You must, of
  94.                                   course, have a color monitor and
  95.                                   card.  See Appendix 3.
  96.            
  97.            Options:
  98.                   
  99.                   /a|A[+|-]       color Attribute selection.  When the
  100.                                   lower-case "a" is used, input is re-
  101.                                   stricted to the eight "normal" color
  102.                                   attributes (0-7).  When the upper-case
  103.                                   "A" is used, input is restricted to
  104.                                   color attributes 0-16.  Including the
  105.                                   "+" or "-" signs after the switch will
  106.                                   display the available colors above or
  107.                                   below the prompt, respectively.
  108.                   
  109.                   /B[+|-]         fix trailing Backslash.  /B+ concat-
  110.  
  111.                                      Page 2
  112.  
  113.  
  114.  
  115.  
  116.  
  117.                                   enates a trailing backslash to the
  118.                                   end of the input string if not al-
  119.                                   ready present.  /B- removes any trail-
  120.                                   ing backslash present.
  121.                                   
  122.         
  123.                   /C              Center output.  Include this switch
  124.                                   if you want your prompt message cen-
  125.                                   tered on the current line.
  126.                   
  127.                   /D              display list of available Disk drives
  128.                                   on current system and restrict input
  129.                                   to one of these letters.
  130.                   
  131.                   /Exxxxxx        Execute command.  Instead of returning
  132.                                   errorlevel, accept text input which is
  133.                                   supplied to command "xxxxxx."
  134.                   
  135.                   /F[nn]          Fixed input field of length nn.  INPUT
  136.                                   will display a fixed, editable input
  137.                                   field of length nn for accepting data.
  138.                                   Cursor arrow, insert/delete, home/end,
  139.                                   and TAB keys are active in this field.
  140.                                   If used in conjunction with the /M
  141.                                   switch, the current value for the en-
  142.                                   vironment variable (if any) is dis-
  143.                                   played in the field as a default.
  144.                                   When this switch is used, TWO color   |
  145.                                   values may be specified.  If more than|
  146.                                   one is used, the FIRST is the color of|
  147.                                   the prompt, and the second is the     |
  148.                                   color of the input field.             |
  149.                                   
  150.                   /H or /?        display brief Help screen.
  151.                   
  152.                   /I              use this for a case-Insensitive error
  153.                                   level return.  If this switch is
  154.                                   included on the command line, pressing
  155.                                   a letter a-z (lower case) will return
  156.                                   the same value as if the corresponding
  157.                                   key A-Z (upper case) were pressed.
  158.                   
  159.                   /Kxxxx          restrict Keypress.  When followed by
  160.                                   a list of characters, INPUT will only
  161.                                   accept those characters, issuing a
  162.                                   warning tone when any other key (ex-
  163.                                   cept ESC) is pressed.  The errorlevel
  164.                                   value returned will equal the ordinal
  165.  
  166.                                      Page 3
  167.  
  168.  
  169.  
  170.  
  171.  
  172.                                   position of the selected character in
  173.                                   the list.
  174.                   
  175.                   /Ln             Leftmost column in which prompt should
  176.                                   appear.
  177.                   
  178.                   /Mxxxxxx        receive text input and set Master en-
  179.                                   vironment variable xxxxxx with data 
  180.                                   received.  Defaults to variable name 
  181.                                   of INPUT if no name is provided.
  182.                   
  183.                   /Oxxxxx         cOncatenate "xxxxxx" to end of data
  184.                                   entered.  Valid only for string input
  185.                                   options /M and /F.  Adds the specified
  186.                                   characters to the end of the value en-
  187.                                   tered by the user.  If you must in-
  188.                                   clude spaces, enclose the whole switch
  189.                                   in quotes.
  190.                                   
  191.                   /Pd             Pause 10 seconds for user input, then 
  192.                                   default to "d" (where "d" is any char-
  193.                                   acter.  INPUT will wait up 10 seconds 
  194.                                   for user input.  If no key is pressed 
  195.                                   within 10 seconds, INPUT will act as  
  196.                                   if the key specified by the key rep-  
  197.                                   resented by the single character "d"  
  198.                                   was pressed.  Note that all other     
  199.                                   switches (case insensitivity, yes/no  
  200.                                   answer, etc.) remain active if time   
  201.                                   expires and the default key is used.  
  202.                                   INPUT adds a warning that it will de- 
  203.                                   fault to the specified value after 10 
  204.                                   seconds, and will display a succession
  205.                                   of ten dots to indicate elapsed time. 
  206.                                   
  207.                   /Q              Quiet mode.  Suppresses the audible
  208.                                   alarm prompt.
  209.                   
  210.                   /Rn             Row in which prompt should appear.
  211.                                   
  212.                   /S              Show keypress.  Adding this switch
  213.                                   will cause INPUT to display the
  214.                                   errorlevel value returned.  Use this
  215.                                   for quick "debugging" of your use
  216.                                   of INPUT
  217.                   
  218.                   /V              instead of a single keypress, causes  
  219.                                   INPUT to read a numeric Value (con-   
  220.  
  221.                                      Page 4
  222.  
  223.  
  224.  
  225.  
  226.  
  227.                                   cluded with a carriage return) between
  228.                                   0 and 255 from the keyboard.  Values
  229.                                   less than 0 will return 0 and values
  230.                                   greater than 255 will return 255.
  231.                                   
  232.                   /Wn             when used in conjunction with the /P
  233.                                   switch, changes the default Wait time
  234.                                   to n seconds, where n is no greater
  235.                                   than 999 seconds.
  236.                   
  237.                   /X              When used in conjunction with the /W 
  238.                                   and/or /P switches will suppress dis-
  239.                                   play of the default value and timer  
  240.                                   "ticks."
  241.                                   
  242.                   /Y              use this for a Yes-no only response.  
  243.                                   If the "n" key is pressed, errorlevel 
  244.                                   of "0" is returned; pressing any other
  245.                                   key returns an errorlevel of 1.  The  
  246.                                   prompt "(Y/n)" is appended to the nor-
  247.                                   mal prompt specified by the user.     
  248.                                   
  249.                   /N              Use this for a yes-No only response.  
  250.                                   If the "y" key is pressed, errorlevel 
  251.                                   of "1" is returned; pressing any other
  252.                                   key returns an errorlevel of 0.  The  
  253.                                   prompt "(y/N)" is appended to the nor-
  254.                                   mal prompt specified by the user.     
  255.                                   This switch takes precedence over the 
  256.                                   /y switch.                            
  257.                                   
  258.                   The command line parameters may be entered in any 
  259.                   order, may be in any case, and may be preceded by 
  260.                   either the "/" or "-" character.     
  261.         
  262.         Examples:
  263.         
  264.              INPUT "Select a number from one to 10"
  265.         
  266.              This prints the text "Select on number from one to 10"
  267.         on the current line and waits for a keypress.
  268.         
  269.              INPUT "Press any key to continue" 79
  270.         
  271.              This prints the text "Press any key to continue" on the
  272.         current line in bright white on a red background and waits
  273.         for a keypress.
  274.         
  275.  
  276.                                      Page 5
  277.  
  278.  
  279.  
  280.  
  281.  
  282.              INPUT "Press the space bar to exit" 143 /c
  283.         
  284.              This prints the text "Press the space bar to exit" cen-
  285.         tered on the current line in flashing bright white on a black
  286.         background.
  287.         
  288.              INPUT /s /i "Press any key..." /c 14
  289.              
  290.              Prompts user with "Press any key..." in yellow on black.
  291.         Returns a case-insensitive errorlevel and displays it on the
  292.         screen before terminating.
  293.         
  294.              INPUT "Do you wish to continue?" /s 79 /y              
  295.              
  296.              Prompts user with "Do you wish to continue? (Y/n)" in 
  297.         white on red.  Returns errorlevel of 1 unless the "n" key is
  298.         pressed.  Displays errorlevel on screen.
  299.         
  300.              INPUT "Press any key..." /pf                               
  301.              
  302.              Prompts user with "Press any key... (defaults to f after 
  303.         10 seconds)" in black on white.  Returns errorlevel of 102 if   
  304.         no key is pressed within 10 seconds, otherwise returns value of 
  305.         key pressed.
  306.         
  307.              INPUT "Press any key..." /c /pf                         
  308.              
  309.              Prompts user with "Press any key... (defaults to f after   
  310.         10 seconds)" in black on white.  Returns errorlevel of 70 if no 
  311.         key is pressed within 10 seconds, otherwise returns the upper   
  312.         case ASCII value of the key pressed.                           
  313.         
  314.              INPUT "Enter data:" /p1 /w15 /q 30
  315.              
  316.              Prompts user with "Enter data: (defaults to 1 after 15
  317.         seconds)" in yellow on blue.  Returns errorlevel of 49 if no
  318.         key is pressed after 15 seconds, otherwise returns the error-
  319.         level of the key pressed.  The alarm does NOT sound.
  320.         
  321.              INPUT "How many copies should be printed? " /v /c
  322.              
  323.              Prompts user with "How many copies should be printed?"
  324.         centered on the current line.  A number can be entered by the
  325.         user and INPUT will return an errorlevel equal to the number
  326.         entered (between 0 and 255).  If the /V switch is used, the
  327.         data entered by the user will appear on screen, and can be
  328.         changed using backspace before pressing <Return>.
  329.         
  330.  
  331.                                      Page 6
  332.  
  333.  
  334.  
  335.  
  336.  
  337.              INPUT "Press any key to continue..." /p /x
  338.              
  339.              Displays the familiar DOS PAUSE message, but exits after
  340.         a 10 second delay if no key is pressed.  An errorlevel of 0 is
  341.         returned.
  342.         
  343.              INPUT "Switch to which drive?" /D
  344.              
  345.              Displays prompt "Switch to which drive?" followed by a
  346.         list of all valid drives on the system.  Will not exit until
  347.         one of these drive letters is pressed.
  348.         
  349.              INPUT "Enter a directory mask " /Edir /C
  350.              
  351.              Centers prompt "Enter a directory mask " on screen.  Exe-
  352.         cutes DOS "dir" command, using any text entered in response to
  353.         prompt as arguments.  For example, if user typed "*.exe /p" the
  354.         command "dir *.exe /p" will be executed by INPUT.  This allows
  355.         INPUT to be used to enter limited string data.
  356.         
  357.             INPUT "Enter a file name: " /MFILENAME
  358.             
  359.             Accepts text data from keyboard and places value entered
  360.         in the master environment in a variable named "filename."  This
  361.         value can later be accessed within a batch file or via other
  362.         programs.
  363.         
  364.              INPUT "New PATH: " /MPATH /F60
  365.              
  366.            Displays the current PATH setting in a fixed-length field 60
  367.         characters wide.  It may then be edited and saved by pressing
  368.         ENTER.
  369.         
  370.              INPUT "Select an option: " /KABC
  371.         
  372.            Returns an errorlevel of 1 if A is pressed, 2 if B, and 3 if
  373.         C is pressed.  Sounds a beep if any other key is pressed and
  374.         waits for valid keypress or ESC.
  375.         
  376.              CD | INPUT /MDIR /Q
  377.         
  378.            In this redirection example, the output of the "CD" command
  379.         is "piped" into INPUT, which stores in information in an envir-
  380.         onment variable called DIR.  (The CD command entered by ltself
  381.         displays the current drive and directory name.)  The output of
  382.         virtually any command can be stored in the environment using
  383.         INPUT in this manner.
  384.         
  385.  
  386.                                      Page 7
  387.  
  388.  
  389.  
  390.  
  391.  
  392.            INPUT will also sound an alarm to let the user know that
  393.         a response is expected (unless /Q switch specified).
  394.         
  395.            When a key is pressed, INPUT will set the errorlevel equal
  396.         to the ASCII value of the key pressed.  This is slightly dif-
  397.         ferent from BATBOX in that in normal operation INPUT is case
  398.         sensitive and will allow you to distinguish between upper and
  399.         lower case letters.  If you want a case-insensitive return, use
  400.         the /i switch.  See Appendix 2 for a complete list of the ASCII
  401.         characters theoretically supported by INPUT.  If the /H or /?
  402.         parameter was specified, the errorlevel returned will be 255.
  403.         
  404.            If the ESC key is pressed, an errorlevel of 254 will be re-
  405.         turned.
  406.         
  407.            When using the /E parameter to execute a batch file, be sure
  408.         to include the extension ".BAT" as part of the switch.
  409.         
  410.            When using the /M switch to set an environment variable, the
  411.         variable name you supply will be converted to upper case.  DOS
  412.         will only recognize upper case variables within batch files.
  413.         
  414.            When using the /M switch in conjunction with /Y or /N, the
  415.         variable will be assigned a value of YES or NO as appropriate.
  416.         
  417.            SPECIAL NOTE TO 4DOS* and NDOS USERS
  418.            
  419.            INPUT.EXE conflicts with 4DOS' INPUT internal command.  To
  420.         remedy this situation, create a batch file containing the two
  421.         lines below (or add them to your AUTOEXEC.BAT file) and execute
  422.         once each time your computer is turned on:
  423.         
  424.              alias input d:\path\input.exe
  425.              alias inp4 *input
  426.              
  427.            The first line creates an alias of "input" for the program 
  428.         INPUT.EXE.  The second line creates an alias of "inp4" for the
  429.         internal 4DOS INPUT command.  Make sure the "d:\path\" part of
  430.         the first line is replaced with the actual drive/path in which
  431.         INPUT.EXE is located on your system.  Since INPUT performs many
  432.         more functions than the 4DOS command, it is desirable to
  433.         avoid any confusion and simply replace 4DOS' INPUT command.
  434.         
  435.         * 4DOS is a registered trademark of JP Software Inc.
  436.          
  437.         OMBUDSMAN
  438.         
  439.           This program is produced by a member of the Association of
  440.  
  441.                                      Page 8
  442.  
  443.  
  444.  
  445.  
  446.  
  447.         Shareware Professionals (ASP).  ASP wants to make sure that
  448.         the shareware principle works for you.  If you are unable to
  449.         resolve a shareware-related problem with an ASP member by
  450.         contacting the member directly, ASP may be able to help.  The
  451.         ASP Ombudsman can help you resolve a dispute or problem with
  452.         an ASP member, but does not provide technical support for 
  453.         members' products.  Please write to the ASP Ombudsman at 545
  454.         Grover Road, Muskegon, MI 49442 or send a CompuServe message
  455.         via CompuServe Mail to ASP Ombudsman, 70007,3536.
  456.         
  457.         
  458.         DISCLAIMER
  459.         
  460.            The programs described in this documentation are guaran-
  461.         teed to do absolutely nothing!  They have, however, in my exper-
  462.         ience performed essentially as described herein.  The author
  463.         will not be responsible for any loss or damages caused through
  464.         the use of these programs.  No warranty, express or implied,
  465.         is provided for this software's performance, merchantability,
  466.         or fitness for a particular purpose.
  467.         
  468.            All trademarks are property of their respective owners.
  469.         
  470.            The programs and documentation are Copyright 1991-1994 by 
  471.         Chuck Steenburgh & Tay-Jee Software.  You are encouraged to 
  472.         distribute these programs provided the following conditions are
  473.         met:
  474.         
  475.            - all files contained in the archive or distribution disk
  476.              must be distributed together in UNMODIFIED form
  477.         
  478.            - you charge no more than a reasonable fee for copying or
  479.              subscription, and clearly indicate that payment of such
  480.              a fee does NOT grant ownership of the programs.
  481.         
  482.            This program is part of set of utilities known as STEEN-
  483.         BURGH'S STUFF (Mildly Useful Utilities).  The full set of
  484.         utilities includes the following programs:
  485.         
  486.              BATBOX:     Simple menu creation/input system
  487.              CHKDRV:     Checks disk drive status
  488.              CHKPRN:     Checks parallel printer status
  489.              CLK:        Displays time on screen
  490.              CURSOR:     Change cursor shape
  491.              DOSVER:     Checks for DOS version currently running
  492.              INPUT:      Simple prompt/input system
  493.              KLS:        Colorful screen-clearing utility
  494.              LAUNCHER:   File selection/execution system
  495.  
  496.                                      Page 9
  497.  
  498.  
  499.  
  500.  
  501.  
  502.              MUSIC:      Plays transcribed sheet music on the PC
  503.              RAND:       Random number generator
  504.              SKIP:       Prints blank lines from batch files
  505.              SOUNDER:    Wide range of noise making options
  506.              SPACE:      File/disk space reporting utility
  507.              WAITFOR:    Timed pauses 
  508.              WHENISIT:   Date/time telling utility
  509.              WRITE:      Colorful output anywhere on screen
  510.              XD:         Create/switch directories at the same time
  511.         
  512.            You may evaluate these programs for up to 30 days on a free
  513.         trial basis.  After 30 days, you should register your use of
  514.         these programs.  The registration fee is $19.95, payable to the
  515.         author at the address given below.
  516.         
  517.         Registration has the following advantages:
  518.         
  519.            - I am improving these programs all the time.  Registration
  520.              will get you IMMEDIATELY a disk with the latest versions
  521.              of the FULL SET of 21 utilities.
  522.         
  523.            - While I can't promise to include everyone's suggestions
  524.              in program updates, you can bet I'll listen to registered
  525.              users before any of you scrounges out there.
  526.         
  527.            - You will make me feel all warm and fuzzy and appreciated, 
  528.              and all that good stuff.
  529.         
  530.            - You will also get an evaluation copy of my text file for-
  531.              matting program (used to produce the margins in this doc-
  532.              ument), and any other electronic creations I have decided
  533.              to unleash on a foolish, unsuspecting world.
  534.            
  535.            - You become eligible for special offers, discounts, and
  536.              other goodies from all sorts of nice folks.  See the file
  537.              COUPON.TXT, or call us at (800)378-3966 for details.
  538.            
  539.            - You will be in compliance with the laws of the United
  540.              States and international treaties.  Spending years in
  541.              jail and paying 000s of dollars in fines just for using
  542.              someone's computer program without paying for it isn't
  543.              a fun thought!  (OK, the shareware police won't track
  544.              you down, but you get the idea...if you use it, and it's
  545.              worth it, pay for it!  Only fair, right?)
  546.         
  547.            Send comments/registrations to:
  548.         
  549.                 Tay-Jee Software
  550.  
  551.                                      Page 10
  552.  
  553.  
  554.  
  555.  
  556.  
  557.                 Post Office Box 835
  558.                 Lexington, VA 24450-0835
  559.                 (703)261-7023
  560.                 
  561.                 !!!VIRGINIA RESIDENTS ADD 4.5SALES TAX!!!
  562.                 
  563.                 !!!ORDERS OUTSIDE NORTH AMERICA ADD $5 SHIPPING!!!
  564.                 
  565.                 CIS 72330,1776 (I haunt the IBMSYS and IBMPRO forums)
  566.         
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.                                      Page 11