Search code examples
basic

Basic Key Off command


I’m just trying to restart an old program that someone setup, so that I can move forward in the simplest manner. Basic is so close to Fortran, but Basic hardly has consult anymore: Here is the start:

10 REM CONCRETE COLUMNS
20 KEY OFF:B=30:PI=3.14159:CRSI$=" ":DIM CO(B,2),SB(B),FB(B),IC(24,3)
30 DEF FNWN(Q)=INT(Q+.999):DEF FNAS(Q$)=ASC(Q$+"*"):DEF FNA(Q)=(A=Q OR A=Q+32):DEF FNI(Q)=INT(Q+.5):DEF FNZ0(Q)=Q-(Q=0)*.000001

I’m immediately thrown off by the “KEY OFF” followed by variable declarations. Does anyone on stackoverflow know the meaning of the command?


Solution

  • In GW-Basic, the 25th row of the screen shows the first 6 characters of some strings that are assigned to the function keys F1 to F10.

    F1 is LIST
    F2 is RUN
    F3 is LOAD"
    F4 is SAVE"
    F5 is CONT
    ...

    What the KEY OFF statement does, is removing this display from the screen. This way the program can use the 25th row of the screen normally.
    There's also KEY ON to turn the display back on.