home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / batch / input18.arj / INPUT.DOC < prev    next >
Encoding:
Text File  |  1992-05-12  |  17.6 KB  |  428 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 2.0
  28.           Copyright 1991,1992 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.         
  57.         
  58.         
  59.         
  60.         
  61.  
  62.                                      Page 1
  63.  
  64.  
  65.  
  66.  
  67.  
  68.         INPUT.EXE 1.8
  69.         Copyright 1991 by 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] [/C] [/H|/?] [/I] [/Pd] [/Q]
  83.                      [/S] [/V] [/Wn] [/X] [/Y|/N]                       |
  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.                   /C              Include this switch if you want
  98.                                   your prompt message centered on
  99.                                   the current line.  If you include
  100.                                   this switch, you MUST include a
  101.                                   color value.
  102.                                   
  103.                   /H or /?        Display brief help screen.            |
  104.                   
  105.                   /I              Use this for a case-insensitive error
  106.                                   level return.  If this switch is
  107.                                   included on the command line, pressing
  108.                                   a letter a-z (lower case) will return
  109.                                   the same value as if the corresponding
  110.                                   key A-Z (upper case) were pressed.
  111.                                   
  112.                   /Pd             Pause 10 seconds for user input, then 
  113.                                   default to "d" (where "d" is any char-
  114.                                   acter.  INPUT will wait up 10 seconds 
  115.                                   for user input.  If no key is pressed 
  116.                                   within 10 seconds, INPUT will act as  
  117.                                   if the key specified by the key rep-  
  118.                                   resented by the single character "d"  
  119.                                   was pressed.  Note that all other     
  120.                                   switches (case insensitivity, yes/no  
  121.                                   answer, etc.) remain active if time   
  122.  
  123.                                      Page 2
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                   expires and the default key is used.  
  130.                                   INPUT adds a warning that it will de- 
  131.                                   fault to the specified value after 10 
  132.                                   seconds, and will display a succession
  133.                                   of ten dots to indicate elapsed time. 
  134.                                   
  135.                   /Q              Quiet mode.  Suppresses the audible
  136.                                   alarm prompt.
  137.                                   
  138.                   /S              Show keypress.  Adding this switch
  139.                                   will cause INPUT to display the
  140.                                   errorlevel value returned.  Use this
  141.                                   for quick "debugging" of your use
  142.                                   of INPUT.EXE
  143.                   
  144.                   /V              Instead of a single keypress, causes  
  145.                                   INPUT to read a numeric value (con-   
  146.                                   cluded with a carriage return) between
  147.                                   0 and 255 from the keyboard.  Values
  148.                                   less than 0 will return 0 and values
  149.                                   greater than 255 will return 255.
  150.                                   
  151.                   /Wn             When used in conjunction with the /P
  152.                                   switch, changes the default wait time
  153.                                   to n seconds, where n is no greater
  154.                                   than 999 seconds.
  155.                   
  156.                   /X              When used in conjunction with the /W  |
  157.                                   and/or /P switches will suppress dis- |
  158.                                   play of the default value and timer   |
  159.                                   "ticks."                              |
  160.                                   
  161.                   /Y              Use this for a yes-no only response.  
  162.                                   If the "n" key is pressed, errorlevel 
  163.                                   of "0" is returned; pressing any other
  164.                                   key returns an errorlevel of 1.  The  
  165.                                   prompt "(Y/n)" is appended to the nor-
  166.                                   mal prompt specified by the user.     
  167.                                   
  168.                   /N              Use this for a yes-no only response.  
  169.                                   If the "y" key is pressed, errorlevel 
  170.                                   of "1" is returned; pressing any other
  171.                                   key returns an errorlevel of 0.  The  
  172.                                   prompt "(y/N)" is appended to the nor-
  173.                                   mal prompt specified by the user.     
  174.                                   This switch takes precedence over the 
  175.                                   /y switch.                            
  176.                                   
  177.                   The command line parameters may be entered in any 
  178.                   order, may be in any case, and may be preceded by 
  179.                   either the "/" or "-" character.     
  180.         
  181.         Examples:
  182.         
  183.  
  184.                                      Page 3
  185.  
  186.  
  187.  
  188.  
  189.  
  190.              INPUT "Select a number from one to 10"
  191.         
  192.              This prints the text "Select on number from one to 10"
  193.         on the current line and waits for a keypress.
  194.         
  195.              INPUT "Press any key to continue" 79
  196.         
  197.              This prints the text "Press any key to continue" on the
  198.         current line in bright white on a red background and waits
  199.         for a keypress.
  200.         
  201.              INPUT "Press the space bar to exit" 143 /c
  202.         
  203.              This prints the text "Press the space bar to exit" cen-
  204.         tered on the current line in flashing bright white on a black
  205.         background.
  206.         
  207.              INPUT /s /i "Press any key..." /c 14
  208.              
  209.              Prompts user with "Press any key..." in yellow on black.
  210.         Returns a case-insensitive errorlevel and displays it on the
  211.         screen before terminating.
  212.         
  213.              INPUT "Do you wish to continue?" /s 79 /y              
  214.              
  215.              Prompts user with "Do you wish to continue? (Y/n)" in 
  216.         white on red.  Returns errorlevel of 1 unless the "n" key is
  217.         pressed.  Displays errorlevel on screen.
  218.         
  219.              INPUT "Press any key..." /pf                               
  220.              
  221.              Prompts user with "Press any key... (defaults to f after 
  222.         10 seconds)" in black on white.  Returns errorlevel of 102 if   
  223.         no key is pressed within 10 seconds, otherwise returns value of 
  224.         key pressed.
  225.         
  226.              INPUT "Press any key..." /c /pf                         
  227.              
  228.              Prompts user with "Press any key... (defaults to f after   
  229.         10 seconds)" in black on white.  Returns errorlevel of 70 if no 
  230.         key is pressed within 10 seconds, otherwise returns the upper   
  231.         case ASCII value of the key pressed.                           
  232.         
  233.              INPUT "Enter data:" /p1 /w15 /q 30
  234.              
  235.              Prompts user with "Enter data: (defaults to 1 after 15
  236.         seconds)" in yellow on blue.  Returns errorlevel of 49 if no
  237.         key is pressed after 15 seconds, otherwise returns the error-
  238.         level of the key pressed.  The alarm does NOT sound.
  239.         
  240.              INPUT "How many copies should be printed? " /v /c
  241.              
  242.              Prompts user with "How many copies should be printed?"
  243.         centered on the current line.  A number can be entered by the
  244.  
  245.                                      Page 4
  246.  
  247.  
  248.  
  249.  
  250.  
  251.         user and INPUT will return an errorlevel equal to the number
  252.         entered (between 0 and 255).  If the /V switch is used, the
  253.         data entered by the user will appear on screen, and can be
  254.         changed using backspace before pressing <Return>.
  255.         
  256.              INPUT "Press any key to continue..." /p /x                 |
  257.              
  258.              Displays the familiar DOS PAUSE message, but exits after   |
  259.         a 10 second delay if no key is pressed.  An errorlevel of 0 is  |
  260.         returned.                                                       |
  261.         
  262.            INPUT will also sound an alarm to let the user know that
  263.         a response is expected (unless /Q switch specified).
  264.         
  265.            When a key is pressed, INPUT will set the errorlevel equal
  266.         to the ASCII value of the key pressed.  This is slightly dif-
  267.         ferent from BATBOX in that in normal operation INPUT is case
  268.         sensitive and will allow you to distinguish between upper and
  269.         lower case letters.  If you want a case-insensitive return, use
  270.         the /i switch.  See Appendix 2 for a complete list of the ASCII
  271.         characters theoretically supported by INPUT.  If the /H or /?
  272.         parameter was specified, the errorlevel returned will be 255.
  273.         
  274.            If you want greater control over the placement of your prompt
  275.         message on the screen, use WRITE in conjunction with INPUT.
  276.         Use WRITE to display your prompt then use INPUT without the
  277.         "prompt," color, or /c parameters.
  278.         
  279.            SPECIAL NOTE TO 4DOS* USERS
  280.            
  281.            INPUT.EXE conflicts with 4DOS' INPUT internal command.  To
  282.         remedy this situation, create a batch file containing the two
  283.         lines below (or add them to your AUTOEXEC.BAT file) and execute
  284.         once each time your computer is turned on:
  285.         
  286.              alias input d:\path\input.exe
  287.              alias inp4 *input
  288.              
  289.            The first line creates an alias of "input" for the program 
  290.         INPUT.EXE.  The second line creates an alias of "inp4" for the
  291.         internal 4DOS INPUT command.
  292.         
  293.         * 4DOS is a registered trademark of JP Software Inc.
  294.         
  295.         
  296.         OMBUDSMAN
  297.         
  298.           This program is produced by a member of the Association of
  299.         Shareware Professionals (ASP).  ASP wants to make sure that
  300.         the shareware principle works for you.  If you are unable to
  301.         resolve a shareware-related problem with an ASP member by
  302.         contacting the member directly, ASP may be able to help.  The
  303.         ASP Ombudsman can help you resolve a dispute or problem with
  304.         an ASP member, but does not provide technical support for 
  305.  
  306.                                      Page 5
  307.  
  308.  
  309.  
  310.  
  311.  
  312.         members' products.  Please write to the ASP Ombudsman at 545
  313.         Grover Road, Muskegon, MI 49442 or send a CompuServe message
  314.         via CompuServe Mail to ASP Ombudsman, 70007,3536.
  315.         
  316.         
  317.         DISCLAIMER
  318.         
  319.            The programs described in this documentation are guaran-
  320.         teed to do absolutely nothing!  They have, however, in my exper-
  321.         ience performed essentially as described herein.  The author
  322.         will not be responsible for any loss or damages caused through
  323.         the use of these programs.  No warranty, express or implied,
  324.         is provided for this software's performance, merchantability,
  325.         or fitness for a particular purpose.
  326.         
  327.            All trademarks are property of their respective owners.
  328.         
  329.            The programs and documentation are Copyright 1991,1992 by 
  330.         Chuck Steenburgh.  You are encouraged to distribute these pro-
  331.         grams provided the following conditions are met:
  332.         
  333.            - all files contained in the archive or distribution disk
  334.              must be distributed together in UNMODIFIED form
  335.         
  336.            - you charge no more than a reasonable fee for copying or
  337.              subscription, and clearly indicate that payment of such
  338.              a fee does NOT grant ownership of the programs.
  339.         
  340.            This program is part of set of utilities known as STEEN-
  341.         BURGH'S STUFF (Mildly Useful Utilities).  The full set of
  342.         utilities includes the following programs:
  343.         
  344.              BATBOX:     Simple menu creation/input system
  345.              CHKPRN:     Checks parallel printer status
  346.              CLK:        Displays time on screen
  347.              CURSOR:     Change cursor shape
  348.              DOSVER:     Checks for DOS version currently running
  349.              INPUT:      Simple prompt/input system
  350.              KLS:        Colorful screen-clearing utility
  351.              LAUNCHER:   File selection/execution system
  352.              MUSIC:      Plays transcribed sheet music on the PC
  353.              RAND:       Random number generator
  354.              SKIP:       Prints blank lines from batch files
  355.              SOUNDER:    Wide range of noise making options
  356.              SPACE:      File/disk space reporting utility
  357.              WAITFOR:    Timed pauses 
  358.              WHENISIT:   Date/time telling utility
  359.              WRITE:      Colorful output anywhere on screen
  360.              XD:         Create/switch directories at the same time
  361.         
  362.            You may evaluate these programs for up to 30 days on a free
  363.         trial basis.  After 30 days, you should register your use of
  364.         these programs.  The registration fee is $20, payable to the
  365.         author at the address given below.  For those registering
  366.  
  367.                                      Page 6
  368.  
  369.  
  370.  
  371.  
  372.  
  373.         directly with Tay-Jee Software, we offer a $5 cash discount.
  374.         
  375.            Let's be real: I don't plan to make a lot of money this way.
  376.         Registration does have its advantages:
  377.         
  378.            - I am improving these programs all the time.  Registration
  379.              will get you IMMEDIATELY a disk with the latest version.
  380.              You will also get the next major release of the program set
  381.              sent to you free of charge.
  382.         
  383.            - While I can't promise to include everyone's suggestions
  384.              in program updates, you can bet I'll listen to registered
  385.              users before any of you scrounges out there.
  386.         
  387.            - You will make me feel all warm and fuzzy and appreciated, 
  388.              and all that good stuff.
  389.         
  390.            - You will also get an evaluation copy of my text file for-
  391.              matting program (used to produce the margins in this doc-
  392.              ument), and any other electronic creations I have decided
  393.              to unleash on a foolish, unsuspecting world.
  394.         
  395.            Send comments/registrations to:
  396.         
  397.                 Tay-Jee Software
  398.                 Post Office Box 835
  399.                 Lexington, VA 24450
  400.                 (703)464-5290
  401.                 
  402.                 !!!VIRGINIA RESIDENTS ADD 4.5SALES TAX!!!
  403.         
  404.                 CIS 72330,1776 (I haunt the IBMSYS and IBMPRO forums)
  405.         
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.                                      Page 7