home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Current Shareware 1994 January
/
SHAR194.ISO
/
educatio
/
flash36.zip
/
GETFKEY.DOC
< prev
next >
Wrap
Text File
|
1992-11-09
|
2KB
|
76 lines
Name: GETFKEY
Copyright 1990, Ed Oliver
Implementation: Turbo Pascal 5.0
Function: Set errorlevel according to function key pressed
Purpose: Allow .BAT files simple menu functions
History: Created- Mar 90 Ed Oliver
Updated-
Input: Keyboard
Output: MS-DOS errorlevel (set to Extended key code)
Processing:
While TRUE do
Read key from keyboard
While key read is not NUL (#0)
read key again
Read key again
If key read is legal function key
Halt with scan code
ERRORLEVEL Values Returned by GETFKEY
Key Shift Ctrl Alt
F1 59 84 94 104
F2 60 85 95 105
F3 61 86 96 106
F4 62 87 97 107
F5 63 88 98 108
F6 64 89 99 109
F7 55 90 100 110
F8 66 91 101 111
F9 67 92 102 112
F10 68 93 103 113
Home 71 71 119 151
End 79 79 117 159
PgUp 73 73 132 153
PgDn 81 81 118 161
^ 72 72 141 152
v 80 80 145 160
< 75 75 115 155
> 77 77 116 157
Typical .BAT file use might be
@echo off
:again
cls
echo.
echo.
echo CHOOSE AN ACTION FROM THE MENU
echo.
echo F1 List the Directory of Drive A:
echo.
echo F2 List the Directory of Drive C:
echo.
echo F3 Exit this menu
echo.
echo.
funky
if not errorlevel 59 goto again
if errorlevel 62 goto again
if errorlevel 61 goto pickf3
if errorlevel 60 goto pickf2
:pickf1
dir a:
pause
goto again
:pickf2
dir c:
pause
goto again
:pickf3