20070 IF K=13 THEN IF WE.MODE=2 THEN IC=WE.CS: R=R+1: WE.INS=0: GOTO 20530 ELSE 20200
20080 IF K=27 THEN IF WE.MODE=2 THEN RETURN ELSE GOTO 20190
20085 WE.CH=1
20090 IF K=8 THEN IF IC>WE.CS THEN IC1=WE.C-1: IC=IC-1: GOTO 20470 ELSE IC1=1: GOTO 20470
20100 IF R<WE.RS OR R>WE.RE OR IC<WE.CS OR IC>WE.CE(SLINE) THEN 20150 ELSE 20500
20110 K=ASC(MID$(A,2,1)): SC=INSTR(AXC$,CHR$(K))
20115 IF WE.MODE=2 AND (K>58 AND K<69) THEN 20150 'no F keys while adding
20120 IF K>58 AND K<69 THEN ON K-58 GOTO 20160,20170,20330,20200,20200,20230,20150,20240,20250,20190
20130 ON SC GOTO 20270,20280,20330,20290,20440,20430,20300,20200,20310,20460,20360,20410,20450,20210,20320,20220,20230,20240,20250,20260,20160,20170,20180,20190
20140 '
20150 SOUND 420,.42: GOTO 20030 'undefined keys
20160 GOSUB 5020: GOSUB 15090 'alt-H, display Help
20165 INX.PTR=INX.PTR+1: GOTO 20330
20170 BEEP: RETURN 'alt-A, add a record
20180 BEEP: RETURN 'alt-S, search
20190 GOTO 9020 'alt-Q, Quit
20200 RETURN 'PgDn, return with k=81
20210 GOSUB 8170: RETURN 1400 'Ctrl-PgDn, set to last record
20220 INX.PTR=0: INX.NXT=0: GOTO 20340 'Ctrl-PgUp, set to first record
20230 GOSUB 11020: GOSUB 15120: GOTO 20340 'alt-D, delete current record
20240 GOSUB 3010: GOTO 20340 'alt-F, find a record
20250 GOSUB 3082: GOTO 20340 'alt-N, find next record
20260 RETURN 'alt-U, return with k=22
20270 IC=WE.CS: GOTO 20030 'Home, col 1
20280 R=R-1: GOTO 20530 'up
20290 IC=IC-1: GOTO 20530 'left
20300 R=R+1: GOTO 20530 'down
20310 WE.INS=NOT WE.INS: GOTO 20530 'Ins
20320 R=WE.RS: IC=WE.CS: GOTO 20030 '^home
20330 IF INX.PTR>1 THEN GOSUB 8110 'PgUp, back up one record
20340 IF WE.MODE=1 THEN BEEP: GOTO 20030 ELSE RETURN 1400