home *** CD-ROM | disk | FTP | other *** search
/ Hall of Fame / HallofFameCDROM.cdr / util2 / withlist.lzh / SETENV.ZIP / README.2 < prev    next >
Text File  |  1988-05-30  |  4KB  |  91 lines

  1.  
  2.    ================== File README.2 =========================
  3.    
  4.    Additional notes from a user of SETENV:
  5.     
  6.    There is a big mistake in the author's documentation. He tells you
  7.    to create a prompt line this way:
  8.     
  9.    SETENV drv PLEASE ENTER THE DRIVE TO USE:
  10.       
  11.    In that case, the program will choke on the first space it finds in
  12.    the command line. You must do it this way:
  13.   
  14.    SETENV drv "PLEASE ENTER THE DRIVE TO USE: "
  15.   
  16.    Note that placing a space following the colon and BEFORE the final
  17.    quote mark will cause the cursor to be positioned one character
  18.    after the colon, which makes for a less confusing screen for anyone
  19.    encountering that prompt line.
  20.   
  21.    The double quote marks will not appear in the on-screen prompt.
  22.    Note that SINGLE quote marks (meaning: ') can't be used here.
  23.   
  24.    You can place ANSI.SYS cursor positioning and screen-attribute
  25.    commands within the prompt line. Example: you want the prompt to be
  26.    in high intensity video. Do this:
  27.   
  28.        SETENV drv "<ESC>[1mPlease enter the drive to use: <ESC>[m"
  29.   
  30.    (where I've used:  <ESC>  above, you'd "quote" the ESC character
  31.    onto the screen as you write the batch file)
  32.   
  33.    Another example:
  34.   
  35.      SETENV drv "<ESC>[J<ESC>[12;7H Please enter the drive to use: "
  36.   
  37.    would clear the screen and then place the prompt line beginning at
  38.    row 12, column 8 (not 7 - because there is a space at the beginning
  39.    of that prompt line).
  40.   
  41.    If you wanted the text that the USER is going to type (following
  42.    the prompt line) to be in a video attribute different from the
  43.    prompt itself, try something like this:
  44.   
  45.    SETENV drv "Please enter the drive to use: <ESC>[1m"
  46.    ECHO <ESC>[m
  47.  
  48.    In that case the prompt would be in normal intensity, and what the
  49.    user types will be in high intensity. Unless you want things to
  50.    remain in high intensity, be sure to reset to normal via the second
  51.    line shown in this last example.
  52.   
  53.    If the user decides to forget the keyboard input and hits the ENTER
  54.    key rather than type something following the prompt, be sure to
  55.    give him/her an "out." If the prompt line is:
  56.   
  57.    SETENV tmp "Enter the file name: "
  58.   
  59.    and the user presses <cr> instead of typing a file name, put a line
  60.    like this into the batch file right below the SETENV instruction:
  61.   
  62.    if "%tmp%"=="" goto NOPARM
  63.    if not "%tmp%"=="" goto PARM
  64.  
  65.    where "NOPARM" is a label in your batch file which allows you to
  66.    terminate the batch file, or does something else you'd want to do
  67.    if there's no keyboard input at that point. And "PARM" is another
  68.    label used when there was indeed some keyboard input following the
  69.    SETENV prompt.
  70.   
  71.    Notwithstanding the author's error in the doc file, this is a super-
  72.    duper idea. At last, something that provides you with more-than-
  73.    single-keystroke keyboard input during a batch file! The caution
  74.    is: what if you run out of environment space because the user
  75.    enters something like:
  76.   
  77.    C:\DIRNAME\TEMP\FILE1.TXT   ... and there isn't enough environment
  78.    space left to hold that variable? Well, then use DOS' environment
  79.    expansion syntax if you have the right DOS version to use it, or
  80.    pick up the nifty program ENVSIZE.COM from a local BBS - and
  81.    dynamically expand your environment that way. Hint - run
  82.    ENVSIZE.COM from your AUTOEXEC.BAT file, not later on in the
  83.    computing session. If you run it later on you may not be able to
  84.    increase the environment size by the desired amount.
  85.   
  86.    This additional verbosity supplied by Mike Arst, Seattle, WA
  87.    (tacked onto/into an .ARC file containing SETENV version 1.1)
  88.  
  89.                              [ end ]
  90.  
  91.