home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 8
/
CDASC08.ISO
/
VRAC
/
BATCHVW1.ZIP
/
ALEARNME.BAT
< prev
next >
Wrap
DOS Batch File
|
1993-07-12
|
12KB
|
314 lines
@ECHO OFF
echo off
AMSG +27 15 113 15 "HOW TO USE THE A BATCH VIEW UTILITY PROGRAMS"
AMSG +27 15 113 15 /ask "Tutorial takes Approximately 10 minutes" Continue
IF ERRORLEVEL 1 GOTO TOK
IF ERRORLEVEL 0 GOTO TUTEND
:TOK
ECHO *******************************************************************
ECHO You can display a Quick Help Screen for any of the utility programs
ECHO by typing its name on the dos command line. The help screens will
ECHO provide you with a short description of how the program operates.
ECHO *
ECHO Just enter the program name on the command line,
ECHO like this...C:\ ACLS
ECHO *
ECHO Here's a look at the help screen for the ACLS program.
ECHO *
PAUSE
ACLS
ECHO *
PAUSE
ACLS /hz
ECHO *****************************************************************
ECHO The method of clearing the screen that you just saw was done with
ECHO the ACLS utility program using the /hz switch.
ECHO *
ECHO ACLS provides several different methods to clear the display
ECHO and is very simple to use.
ECHO *
ECHO You determine the method ACLS will use by passing it the desired
ECHO option switch on the Dos command line.
ECHO *
ECHO You're probably already familiar with switches from using DOS.
ECHO ACLS operates in a similar manner.
ECHO *
ECHO A switch or an option is entered after the program name
ECHO and separated by a space.
ECHO *
ECHO Like this.... ACLS /hz
ECHO *
ECHO Make sure you enter a space between the program name and the switch!
ECHO *
ECHO Just in case you missed some of the ACLS options the first time,
ECHO here's a chance to check them out again.
ECHO *
PAUSE
ACLS
ECHO *
PAUSE
ACLS /c 7 16
ECHO ***************************************************************
ECHO ACLS can also be used to change the default screen colors.
ECHO *
ECHO If you have a color monitor, the text you're reading should
ECHO be light gray and the background blue.
ECHO *
ECHO To use ACLS to change the screen colors you would use the
ECHO /c switch followed by the foreground and background color
ECHO attributes.
ECHO *
ECHO Typing ACLS /c 7 16 on the command line produces this screen.
ECHO The 7 represents the text or foreground color,
ECHO and the 16 designates the blue background.
ECHO *
ECHO All the A BATCH VIEW Utility Programs use color attributes to
ECHO control screen colors. Attributes can be referenced in the
ECHO Software Manual, or by entering a /c or color switch alone
ECHO after any of the utility program names. The AEXAMPLS.BAT file
ECHO will also demonstrate the use of attributes.
ECHO *
ECHO Typing ... ACLS color or ACLS /c, displays the attributes.
ECHO *
PAUSE
ACLS color
ECHO *
PAUSE
ACLS /out
ECHO ***************************************************************
ECHO HOW TO USE AMSG
ECHO *
ECHO AMSG generates display windows for any relevant information
ECHO you might wish to pass on to users of your batch files.
ECHO *
ECHO You can also use it to ask questions to determine the
ECHO appropriate course of action for your batch file.
ECHO *
ECHO To use AMSG you must tell it what to put on the display screen.
ECHO You pass the controlling parameters to AMSG in the same manner
ECHO that was demonstrated for the ACLS program.
ECHO *
ECHO AMSG automatically centers the message window on the screen.
ECHO *
ECHO To display a black & white message
ECHO you would type..... AMSG 197 "Hey you, read this!"
ECHO *
PAUSE
AMSG 197 "Hey you, read this!"
ECHO ********************************************************************
ECHO As was just seen, the window is automatically centered on the screen
ECHO and an instructional prompt is added to your text..
ECHO *
ECHO Hopefully, you're still wondering what the number 197 did on
ECHO the previous display screen. 197 represents the ascii code that
ECHO filled the background screen providing the wallpaper and allowing
ECHO you to see the shadowed backdrop of the pop up window.
ECHO You can use the AVIEWDOC Batch file to see a listing of Ascii codes.
ECHO *
ECHO The format for black and white message prompts is....
ECHO *
ECHO AMSG screen-ascii messages....
ECHO *
ECHO SCREEN-ASCII = The Ascii code for the background.
ECHO *
ECHO Before we cover information about message options,
ECHO here's a quick look at the available ASCII CODES.
ECHO Again, you can use AVIEWDOC.BAT to view them.
ECHO *
PAUSE
APAGE ASCIICDS.DOC 7 16
ECHO ******************************************************************
ECHO The message option is where you enter the text you want displayed.
ECHO *
ECHO Entering...AMSG 197 "Hey you, read this!" displays a message
ECHO window with the text on one line.
ECHO *
ECHO Enclosing your message within quotation marks ensures that
ECHO it will be displayed as one line of text. If you wish to break
ECHO up your message into several lines, enclose each segment of text
ECHO with quotes. The text is automatically centered inside the window.
ECHO *
ECHO AMSG 197 "Hey you," "read this!"
ECHO *
ECHO This will display your message on two lines in the display window.
ECHO *
ECHO To review what was just covered and see what else AMSG can do
ECHO here's a look at its Quick Help Screen.
ECHO *
PAUSE
AMSG
PAUSE
ACLS /vt
ECHO ****************************************************************
ECHO Amsg allows you to display information about the computer system
ECHO with, or without adding your own message text.
ECHO *
ECHO To do this you add the desired option switch in this format..
ECHO *
ECHO AMSG screen-ascii [option switch] messages....
ECHO *
ECHO There are four available option switches.
ECHO Three switches display system information ( /td, /dsk, /env ),
ECHO and the other ( /ask ) turns your message into a question.
ECHO *
ECHO *
ECHO Its a lot easier to show you what the switches do, as opposed
ECHO to describing them, so here's a few examples.
ECHO *
PAUSE
AMSG +27 15 113 15 /td "/td - Shows the Time and Date"
AMSG +27 15 113 15 /dsk "/dsk - Shows the Directory and Disk Drives"
AMSG +27 15 113 15 /env "/env - Shows your Environment Variables and Dos Version"
AMSG +27 15 113 15 /ask "/ask - Shows a test question with two answers" "Press Y or N"
IF ERRORLEVEL 1 GOTO YSEL
IF ERRORLEVEL 0 GOTO NOSEL
:YSEL
ECHO ***************************************************************
ECHO You selected a yes answer and AMSG returned Errorlevel code 1
GOTO SELEND
:NOSEL
ECHO **************************************************************
ECHO You selected a no answer and AMSG returned Errorlevel code 0
:SELEND
ECHO to the batch file.
ECHO *
ECHO The /ask option enables you to force a binary question.
ECHO It only accepts a Y or N keypress but is not sensitive
ECHO about upper or lower case responses.
ECHO *
ECHO AMSG always returns an errorlevel code of 0 unless
ECHO you use the /ask option and the Y key was pressed.
ECHO *
PAUSE
ACLS /wr
ECHO ******************************************************************
ECHO To produce color message prompts use this format.
ECHO AMSG +window wndtxt screen screen-ascii [switch] [messages..]
ECHO *
ECHO Three color attributes are needed between the program name
ECHO and the screen ascii code. Notice the + sign denoting color.
ECHO *
ECHO Color Attributes are constructed for the display window and
ECHO the background screen. The window text uses the window color
ECHO for its background so entering a foreground attribute is all
ECHO that's necessary.
ECHO *
ECHO Color attributes are constructed by adding background and
ECHO foreground colors. For a blue window bordered in bright white
ECHO you would add 16 + 15 = 31.
ECHO *
ECHO 16 = Blue Background 15 = White Foreground
ECHO *
ECHO AMSG +31 15 113 15 "An example color message"
ECHO produces a blue window bordered in white, with white message text.
ECHO The screen has a white background with blue text, and ascii code
ECHO 15 is used for the wallpapering. Here it is on the screen.
ECHO *
PAUSE
AMSG +31 15 113 15 "An example color message"
AMSG /c
ECHO *
PAUSE
ACLS /wl
ECHO *****************************************************************
ECHO HOW TO USE ABATMENU
ECHO *
ECHO To generate a Black and White Menu, pass these arguments...
ECHO *
ECHO ABATMENU screen-ascii Menu-Title Selection-Names...
ECHO *
ECHO SCRN-ASCII = Ascii code, or number for the screen background.
ECHO MENU-TITLE = Word or text you enter for the menu title.
ECHO SELECTION-NAMES = The menu selections you wish to offer.
ECHO *
ECHO Abatmenu returns an errorlevel code to the batch file, with each
ECHO code corresponding to the item selected. Arrow keys move hi-lite,
ECHO Enter key selects, and the ESC key exits returning a ZERO.
ECHO *
ECHO Typing ....
ECHO ABATMENU 177 " B&W MENU " Select1 Select2 Select3 Exit
ECHO on the command line or in a batch file
ECHO produces the following menu.
ECHO *
PAUSE
:EXMPL
abatmenu 177 " B&W MENU " Select1 Select2 Select3 Exit
IF ERRORLEVEL 4 GOTO XEND
IF ERRORLEVEL 3 GOTO THREE
IF ERRORLEVEL 2 GOTO TWO
IF ERRORLEVEL 1 GOTO ONE
IF ERRORLEVEL 0 GOTO ESCKEY
GOTO EXMPL
:ONE
ECHO ***********************************************************
ECHO You Chose Selection 1
ECHO Abatmenu Returned Errorlevel Code 1
GOTO BTEND
:TWO
ECHO ***********************************************************
ECHO You Chose Selection 2
ECHO Abatmenu Returned Errorlevel Code 2
GOTO BTEND
:THREE
ECHO *****************************************************************
ECHO You Chose Selection 3
ECHO Abatmenu Returned Errorlevel Code 3
GOTO BTEND
:XEND
ECHO *****************************************************************
ECHO You Chose Selection Exit
ECHO Abatmenu Returned Errorlevel Code 4
GOTO BTEND
:ESCKEY
ECHO *****************************************************************
ECHO You Pressed the ESC key
ECHO Abatmenu Returned Errorlevel Code 0
:BTEND
ECHO *
ECHO You can set up your batch file to use the Errorlevel Code
ECHO Abatmenu returns by using the .....
ECHO IF ERRORLEVEL (code#) GOTO (a label)
ECHO statement to perform actions associated with the Selection.
ECHO *
ECHO The manual contains an example of this in the Batch File Section.
ECHO *
ECHO *********************************************************************
ECHO To produce color menus ABATMENU needs four color attributes.
ECHO One each for the menu, menu text, hi-lite bar, and background screen.
ECHO *
ECHO The format is similar to AMSG except that four attributes are used.
ECHO *
ECHO ABATMENU +31 15 116 113 15 "* Menu *" Select1 Select2 Select3 Exit
ECHO *
ECHO The above will generate a simple color menu with 4 selections.
ECHO *
PAUSE
ABATMENU +31 15 116 113 15 Menu Select1 Select2 Select3 Exit
ECHO ********************************************************************
ECHO If the use of color attributes is still unclear, the manual contains
ECHO several examples of how to construct and use attributes with the
ECHO utility programs.
ECHO *
ECHO AVIEWDOC.BAT allows you to view the software documents.
ECHO *
ECHO APRNTDOC.BAT allows you to print the software documents.
ECHO *
ECHO *
ECHO ABATMENU and AMSG also allow you to use Ascii Text Files
ECHO to store multiple program option sets for complex batch files.
ECHO *
ECHO **********************************************************
ECHO * ATXTFILE.BAT shows the use of text files for options. *
ECHO **********************************************************
ECHO *
ECHO *******************************************************
ECHO * AEXMPLES.BAT shows several color menus and messages *
ECHO *******************************************************
ECHO *
ECHO Good Luck!
ECHO *
PAUSE
ACLS /hz
:TUTEND