41. User key editor
~~~~~~~~~~~~~~~
This is a short program which lists all the current user-key definitions, and
not just the red ones. You can then edit them, if you wish, using the cursor
and keys as usual. The number of bytes used up by the definitions is
displayed; 239 is the maximum available. This was adapted from an original
which I think was published in "Acorn User". You can omit all spaces in the
listing, if you wish, except those inside quotes. This applies to the BBC B
(& B+ ?) but not the Master or Compact.
100 MODE7:@%=&902:M%=0:PRINT'"Keylist":FOR K%=0 TO 15
110 PRINT'" *KEY"K%" ";:A%=K%?&B00:B%=256:FOR T%=0 TO 15
120 S%=T%?&B00:IF S%>A% AND S%<=B% THEN B%=S%
130 NEXT:IF B%=256 THEN 170
140 FOR G%=A% TO B%-1:H%=G%?&B01:M%=M%+1
150 IF H%>31 THEN VDU H% ELSE VDU 124,H%+64
160 NEXT
170 NEXT:@%=&90A:PRINT'';M%;" bytes used." :REM max is 239