;; all the 'e' is a null 

 500 LL=80:REM LINE LENGTH              
 550 NL=100:REM NUMBEROFLINES           
 600 DIM BUF$(LL*NL),L$(LL)             
 650 BUF$="e":BUF$(LL*NL)="e"           
 700 BUF$(2)=BUF$                       
 750 BUF$(LL-(LL-1),LL)="eeee"          
 800 DIM C$(6)                          
 850 INPUT C$                           
 900 L$=" "                             
 910 IF C$<>"N" THEN 950                
 920 GOSUB 7300                         
 950 IF C$<>"S" THEN 1050               
 1000 GOSUB 5850                        
 1050 IF C$<>"L" THEN 1150              
 1100 GOSUB 6650                        
 1150 IF C$<>"C" THEN 1300              
 1200 PRINT "LINE:";:INPUT LINE         
 1250 GOSUB 5300                        
 1300 IF C$<>"A" THEN 1400              
 1350 GOSUB 1950                        
 1400 IF C$<>"P" THEN 1500              
 1450 GOSUB 3250                        
 1500 IF C$<>"I" THEN 1650              
 1550 PRINT "LINE:";:INPUT LINE         
 1600 GOSUB 3800                        
 1650 IF C$<>"D" THEN 1800              
 1700 PRINT "LINE:";:INPUT LINE         
 1750 GOSUB 4800                        
 1800 IF C$<>"Q" THEN 1900              
 1850 END                               
 1900 GOTO 850                          
 1950 REM ****************************  
 2000 REM ***** APPEND                  
 2050 FOR I=1 TO NL                     
 2100 A1=I*LL                           
 2150 A2=A1-(LL-1)                      
 2200 IF BUF$(A2,A2+3)="eeee" THEN 2300 
 2250 NEXT I                            
 2300 FOR A=I TO NL                     
 2350 A1=A*LL                           
 2400 A2=A1-(LL-1)                      
 2450 L$=" "                            
 2500 INPUT #16,L$                      
 2550 IF L$="." THEN 850                
 2600 FOR J=A2 TO A1                    
 2650 BUF$(J,A1)="e"                    
 2700 NEXT J                            
 2750 IF L$="" THEN L$=" "              
 2800 BUF$(A2,A1)=L$                    
 2850 IF A=10 THEN 3100                 
 2900 A1=(A+1)*LL                       
 2950 A2=A1-(LL-1)                      
 3000 BUF$(A2,A1)="eeee"                
 3050 NEXT A                            
 3100 RETURN                            
 3150 REM **************************    
 3200 REM *** PRINT                     
 3250 FOR A=1 TO NL                     
 3300 A1=A*LL                           
 3350 A2=A1-(LL-1)                      
 3400 FOR K=A2 TO A1                    
 3450 IF BUF$(K,K)="e" THEN 3600        
 3500 PRINT BUF$(K,K);                  
 3550 NEXT K                            
 3600 PRINT                             
 3650 IF BUF$(A2,A2+3)="eeee" THEN 850  
 3700 NEXT A                            
 3750 RETURN                            
 3800 REM ****************************  
 3850 REM ***** INSERT                  
 3900 FOR I=1 TO NL                     
 3950 A1=I*LL                           
 4000 A2=A1-(LL-1)                      
 4050 IF BUF$(A2,A2+3)="eeee" THEN 4150 
 4100 NEXT I                            
 4150 A1=I*LL                           
 4200 A2=A1-(LL-1)                      
 4250 B1=(I+1)*LL                       
 4300 B2=B1-(LL-1)                      
 4350 BUF$(B2,B1)=BUF$(A2,A1)           
 4400 IF I=LINE THEN 4550               
 4450 I=I-1                             
 4500 GOTO 4150                         
 4550 FOR J=A2 TO A1                    
 4600 BUF$(J,A1)="e"                    
 4650 NEXT J                            
 4700 BUF$(A2,A1)=" "                   
 4750 RETURN                            
 4800 REM **************************    
 4850 REM *** DELETE                    
 4900 FOR A=LINE TO NL                  
 4950 A1=A*LL                           
 5000 A2=A1-(LL-1)                      
 5050 B1=(A+1)*LL:B2=B1-(LL-1)          
 5100 BUF$(A2,A1)=BUF$(B2,B1)           
 5150 IF BUF$(A2,A2+3)="eeee" THEN 850  
 5200 NEXT A                            
 5250 RETURN                            
 5300 REM **************************    
 5350 REM *** CHANGE                    
 5400 A=LINE                            
 5450 A1=A*LL                           
 5500 A2=A1-(LL-1)                      
 5550 INPUT L$                          
 5600 FOR J=A2 TO A1                    
 5650 BUF$(J,A1)=CHR$(0)                
 5700 NEXT J                            
 5750 BUF$(A2,A1)=L$                    
 5800 RETURN                            
 5850 REM **************************    
 5900 REM *** SAVE                      
 5950 FOR I=1 TO NL                     
 6000 A1=I*LL                           
 6050 A2=A1-(LL-1)                      
 6100 IF BUF$(A2,A2+3)="eeee" THEN 6200 
 6150 NEXT I                            
 6200 CLOSE #1                          
 6250 OPEN #1,8,0,"C:TMP"               
 6300 FOR J=1 TO I                      
 6350 A1=J*LL                           
 6400 A2=A1-(LL-1)                      
 6450 PRINT #1;BUF$(A2,A1)              
 6500 NEXT J                            
 6550 CLOSE #1                          
 6600 RETURN                            
 6650 REM **************************    
 6700 REM *** LOAD                      
 6750 CLOSE #1                          
 6800 OPEN #1,4,0,"C:TMP"               
 6850 FOR I=1 TO NL                     
 6900 A1=I*LL                           
 6950 A2=A1-(LL-1)                      
 7000 INPUT #1,L$:PRINT L$              
 7050 BUF$(A2,A1)=L$                    
 7100 IF L$(1,3)="eee" THEN 7200        
 7150 NEXT I                            
 7200 CLOSE #1                          
 7250 RETURN                            
 7300 REM **************************    
 7350 REM *** NUMBERED PRINT            
 7400 FOR A=1 TO NL                     
 7450 A1=A*LL                           
 7500 A2=A1-(LL-1)                      
 7510 PRINT A;                          
 7550 FOR K=A2 TO A1                    
 7600 IF BUF$(K,K)="e" THEN 7750        
 7650 PRINT BUF$(K,K);                  
 7700 NEXT K                            
 7750 PRINT                             
 7800 IF BUF$(A2,A2+3)="eeee" THEN 850  
 7850 NEXT A                            
 7900 RETURN