home *** CD-ROM | disk | FTP | other *** search
-
- ================== File README.2 =========================
-
- Additional notes from a user of SETENV:
-
- There is a big mistake in the author's documentation. He tells you
- to create a prompt line this way:
-
- SETENV drv PLEASE ENTER THE DRIVE TO USE:
-
- In that case, the program will choke on the first space it finds in
- the command line. You must do it this way:
-
- SETENV drv "PLEASE ENTER THE DRIVE TO USE: "
-
- Note that placing a space following the colon and BEFORE the final
- quote mark will cause the cursor to be positioned one character
- after the colon, which makes for a less confusing screen for anyone
- encountering that prompt line.
-
- The double quote marks will not appear in the on-screen prompt.
- Note that SINGLE quote marks (meaning: ') can't be used here.
-
- You can place ANSI.SYS cursor positioning and screen-attribute
- commands within the prompt line. Example: you want the prompt to be
- in high intensity video. Do this:
-
- SETENV drv "<ESC>[1mPlease enter the drive to use: <ESC>[m"
-
- (where I've used: <ESC> above, you'd "quote" the ESC character
- onto the screen as you write the batch file)
-
- Another example:
-
- SETENV drv "<ESC>[J<ESC>[12;7H Please enter the drive to use: "
-
- would clear the screen and then place the prompt line beginning at
- row 12, column 8 (not 7 - because there is a space at the beginning
- of that prompt line).
-
- If you wanted the text that the USER is going to type (following
- the prompt line) to be in a video attribute different from the
- prompt itself, try something like this:
-
- SETENV drv "Please enter the drive to use: <ESC>[1m"
- ECHO <ESC>[m
-
- In that case the prompt would be in normal intensity, and what the
- user types will be in high intensity. Unless you want things to
- remain in high intensity, be sure to reset to normal via the second
- line shown in this last example.
-
- If the user decides to forget the keyboard input and hits the ENTER
- key rather than type something following the prompt, be sure to
- give him/her an "out." If the prompt line is:
-
- SETENV tmp "Enter the file name: "
-
- and the user presses <cr> instead of typing a file name, put a line
- like this into the batch file right below the SETENV instruction:
-
- if "%tmp%"=="" goto NOPARM
- if not "%tmp%"=="" goto PARM
-
- where "NOPARM" is a label in your batch file which allows you to
- terminate the batch file, or does something else you'd want to do
- if there's no keyboard input at that point. And "PARM" is another
- label used when there was indeed some keyboard input following the
- SETENV prompt.
-
- Notwithstanding the author's error in the doc file, this is a super-
- duper idea. At last, something that provides you with more-than-
- single-keystroke keyboard input during a batch file! The caution
- is: what if you run out of environment space because the user
- enters something like:
-
- C:\DIRNAME\TEMP\FILE1.TXT ... and there isn't enough environment
- space left to hold that variable? Well, then use DOS' environment
- expansion syntax if you have the right DOS version to use it, or
- pick up the nifty program ENVSIZE.COM from a local BBS - and
- dynamically expand your environment that way. Hint - run
- ENVSIZE.COM from your AUTOEXEC.BAT file, not later on in the
- computing session. If you run it later on you may not be able to
- increase the environment size by the desired amount.
-
- This additional verbosity supplied by Mike Arst, Seattle, WA
- (tacked onto/into an .ARC file containing SETENV version 1.1)
-
- [ end ]
-
-