LPL Topics
The Function Keys
23-38 Using the LI-6400
23
There are some other options with function keys. For example, should the la-
bels appear all the time, or just when the user presses the labels key? Should
the current level of function keys be displayed in the lower left hand corner
of the display? Both of these are controlled by parameters in the call to
MAKESOFT.
Another question is this: what happens to the function key definitions while
a function key is being processed (that is, while the function associated with
a key is being executed)? Do the key labels stay visible? Should the function
keyÕs definition be allowed to change? If another IDLE is encountered, do the
old key definitions stay active? When the IDLE is done, do the old key defi-
nitions get restored? All of this is controlled by one flag set with the keyword
GLOBALKEYS.
:FCT Main
{
/* Illustrate use of function keys
*/
CLEAR
0 ' ' 1 2 0 5 MAKESOFT
/* 0 - plain text for label
delimiter
' ' - the delimiter is a space
1 - inverse labels
2 - labels 2 lines high
0 - donÕt save background beneath
the labels
5 - total of 5 function keys
allowed
*/
/* Fct Key 1 */
"PRINT TIME" &PrintTime 1 ONSOFT
/* Fct Key 2 */
"PRINT DATE" &PrintDate 2 ONSOFT
/* Fct Key 3 */
"PRINT Ctime" &PrintCTime 3 ONSOFT
/* Fct Key 5 */
" quit" &Quit 5 ONSOFT
SHOWSOFT
IDLE
FREESOFT
}
/* When FctKey 1 pressed */
PrintTime
{
1 1 POSXY
GETTDS TIME "Time is %2d:%2d:%2d"
PRINT
}
/* When Fct Key 2 pressed */
PrintDate
{
1 2 POSXY
GETTDS DATE "Year: %d Month:%d
Day:%d" PRINT
}
/* When Fct Key 3 pressed */
PrintCTime
{
1 3 POSXY
GETTDS CTIME
}
/* When Fct Key 5 pressed */
Quit { HALT }
Figure 23-18. Defining function keys