home *** CD-ROM | disk | FTP | other *** search
-
-
- ECHO OFF
- .This demonstrates the INPUT program
- .Use the ECHO statements to create a menu, then branch on the keyin
- CLS
- ECHO To do the first thing type A
- ECHO To do the second thing type B
- ECHO To do the third thing type 3
- ECHO To do the fourth thing type D
- ECHO To do the fifth thing type E
- ECHO .
- .Notice that the input can be any printable key (but forced to upper case)
- INPUT "AB3DE"
- ECHO .
- .Note that the IF ERRORLEVEL checks for error or HIGHER,so you must test
- .in reverse order (high first)
- .ESC always returns a 255 value
- IF ERRORLEVEL 255 GOTO ESC
- IF ERRORLEVEL 5 GOTO FIVE
- IF ERRORLEVEL 4 GOTO FOUR
- IF ERRORLEVEL 3 GOTO THREE
- IF ERRORLEVEL 2 GOTO TWO
- IF ERRORLEVEL 1 GOTO ONE
- :ESC
- ECHO You pressed the ESC key
- GOTO STOP
- :ONE
- ECHO You pressed the A key
- .User can run a program here
- GOTO STOP
- :TWO
- ECHO You pressed the B key
- .User can run a program here
- GOTO STOP
- :THREE
- ECHO You pressed the 3 key
- .User can run a program here
- GOTO STOP
- :FOUR
- ECHO You pressed the D key
- .User can run a program here
- GOTO STOP
- :FIVE
- ECHO You pressed the E key
- .User can run a program here
- GOTO STOP
- :STOP
- .Then start another batch file with a different menu
-
- ed the E key
- .User can run a program here
- GOT