* GRIMM ENTERPRISES
* WRITTEN BY J.C. GRIMM
* CIS # 73537,2403
* BELMONT, OHIO 43718
* Here is a quick and easy way to program your FUNCTION keys for different
* procedures. It was designed so that, during programming, you can assign
* procedures to a function key with the addition of only one (1) line of code.
* This makes easy work in the development process. It was also designed to
* turn the function keys off when you are within one of these procedures.
* I designed it this way for simplicity. Confusion of multiple windows on
* the screen in conjunction with "save screen" and "restore screen" caused
* unnecessary problems. I wanted the code to be very simple and straight
* I originally wanted to find a way to save the EXACT status of the fkeys
* to a disk file or something similar to that. I would have like to have
* a procedure that would work like the "SAVE SCREEN" command. That would
* be great. Just have a single command like "SAVE FKEYS". Basically this
* is what I have done in a very few lines of code. It also maintains its
* I have developed many such generic functions and procedures throughout the
* development of an Optometric Office Management software package, due for
* release soon, over the past 3 years. Keep an eye on Compuserve Nanforum
* for future procedures and the release of the Optometric Package.
* Any suggestions on this or future procedures to simplify the code are
* welcome. If you like and use this procedure, you are welcome to do so, but
* mention me somewhere within your program. Thanks!
* Portions of the code are as follows:
* Declare the memory variables in the calling program or, as I did, declare
* them public.
* Main program to add or edit data
DO WHILE ! DONE
* turn off all fkeys
* clear all fkey variables
* assign new memory variables
FKEY3="MEMEDIT" && F3 KEY memedit is a procedure name
FKEY2="ZIPS" && F2 KEY zips is a procedure name
* turn on fkeys with appropriate memory variables as defined above
* program code to paint screen, input data, edit data, etc.
* turn off fkeys after finished with edit screen
* clear all fkey variables just in case ( I'm cautious)
* Library of procedures. ( I like to put them in my first overlay file )
* just make sure your programs have access to them.
* Procedure to assign dummy value to unnecessary fkeys
* Procedure to set fkeys for named procedures
SET KEY 28 TO HELP
SET KEY -1 TO &FKEY2
SET KEY -2 TO &FKEY3
SET KEY -3 TO &FKEY4
SET KEY -4 TO &FKEY5
SET KEY -5 TO &FKEY6
SET KEY -6 TO &FKEY7
SET KEY -7 TO &FKEY8
SET KEY -8 TO &FKEY9
* Procedure to turn off fkeys.
SET KEY -8 TO && F9 KEY
SET KEY -7 TO && F8 KEY
SET KEY -6 TO && F7 KEY
SET KEY -5 TO && F6 KEY
SET KEY -4 TO && F5 KEY
SET KEY -3 TO && F4 KEY
SET KEY -2 TO && F3 KEY
SET KEY -1 TO && F2 KEY
* Procedure to assign a dummy value to the fkeys memory variables.
* Program portion of procedure called when fkey is struck
PROCEDURE ZIPS && list zip codes to screen, etc.
* turn off remaining fkeys
* turn off help ( I like it that way )
SET KEY 28 TO
* select database
* list zips to screen etc.
* close data file
* turn on fkeys exactly as they were set prior to this procedure