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