10 :REMARK  OLDROUTE.BAS\tNAVPROGseven Route Retrieval Program        08-Jan-81
20 :REMARK 
30 :REMARK  Developed by\tAlan Bose   (AOPA 642188)
40 :REMARK \t\t\tVice President, Taildragger Flyers
50 :REMARK \t\t\tRoss Field, Benton Harbor, MI
60 :REMARK 
70 CLEAR 3000:WIDTH 255:ON ERROR GOTO 790
80 BL$=CHR$(7):E$=CHR$(27):ER$=E$+"E":PG$=E$+"p":QG$=E$+"q":Y$=E$+"Y": \n   L$=E$+"l":J$=E$+"j":K$=E$+"k":J1$=E$+"J"
90 DEF FN C$(C1,C2)=Y$+CHR$(C1+31)+CHR$(C2+31)
100 FOR I=8383 TO 8391:D1$=D1$+CHR$(PEEK(I)):NEXT I
110 HD$="N A V P R O G s e v e n   R O U T E   R E T R I E V A L"
120 PRINT PG$;ER$
130 PRINT TAB(40-(LEN(HD$)/2));HD$;TAB(79);QG$
140 PRINT:PRINT"Routes on file: ";
150 :REMARK 
160 OPEN"I",1,"SY1:ROUTINGS.DAT"
170 INPUT #1,M
180 DIM RT$(M+1)
190 FOR J=1 TO M:LINE INPUT #1,RT$(J)
200 NEXT J:CLOSE
210 FOR J=1 TO M
220 CO=((JMOD16)*20)+1:RO=(J \ 16)+5
230 PRINT FNC$(RO,CO);J;FNC$(RO,CO+5);"-  ";LEFT$(RT$(J),3);" to ";RIGHT$(RT$(J),3)
240 NEXT J
250 :REMARK 
260 PRINT FNC$(22,1);J1$;"Enter selection  <MENU>  ";J$;STRING$(2,95)
270 PRINT:PRINT"Enter `D' for delete mode    Enter `P' for printout";:PRINT K$;
280 LINE INPUT X$:IF X$="" THEN CLOSE:LOAD"MENU",R
290 IF X$="D" OR X$="d" THEN 850
300 IF X$="P" OR X$="p" THEN 390
310 X=VAL(X$):IF X>M OR X<1 THEN PRINT BL$:GOTO260
320 RT$=RT$(X):IF ASC(RT$)<65 OR ASC(RT$)>90 THEN RT$="X"+RT$
330 F$="SY1:"+RT$
340 GOSUB650
350 F$="SY1:FLIGHT.SEQ"
360 GOSUB730
370 PRINT ER$;"Standby one...":LOAD"NAVPROG7",R
380 :REMARK 
390 OPEN"O",2,"LP:"
400 PRINT#2,"Air routes currently on file";TAB(60);D1$:PRINT#2,
410 FOR I=1 TO M
420 RT$=RT$(I):IF ASC(RT$)<65 OR ASC(RT$)>90 THEN RT$="X"+RT$
430 F$="SY1:"+RT$
440 GOSUB650:PRINT#2,I;TAB(4);
450 FOR K=1 TO N:SP=INSTR(I$(K)," "):IF SP=0 THEN SP=6
460 PRINT#2,LEFT$(I$(K),SP-1);
470 IF K=N THEN PRINT#2, :ELSE PRINT#2," -> ";
480 NEXT K:NEXT I
490 OPEN"I",3,"SY1:RNAVLIST.DAT"
500 INPUT#3,KY
510 DIM LI$(KY),R1$(KY),R1(KY),R2$(KY),R2(KY)
520 FOR J=1 TO KY:LINE INPUT#3,LI$(J)
530 LINE INPUT#3,R1$(J)
540 INPUT#3,R1(J)
550 LINE INPUT#3,R2$(J)
560 INPUT#3,R2(J)
570 NEXT J:CLOSE#3
580 PRINT#2,:PRINT#2,:PRINT#2,"RNAV cross-references on file:":PRINT#2,
590 FOR J=1 TO KY:PRINT#2,"    ";LI$(J);" <-- ";
600 NV=1:IF R1$(J)<>"" THEN PRINT#2,"NAV";NV;"= ";R1$(J);"  ";:NV=2
610 IF R2$(J)<>"" THEN PRINT#2,"NAV";NV;"= ";R2$(J) :ELSE PRINT#2,
620 NEXT J
625 ERASE LI$,R1$,R1,R2$,R2
630 CLOSE#2:GOTO260
640 :REMARK 
650 OPEN "I",1,F$
660 FOR J=1 TO 10
670 LINE INPUT#1,I$(J)
680 INPUT #1,REF(J)
690 N=J
700 NEXT J:CLOSE#1
710 RETURN
720 :REMARK 
730 OPEN"O",1,F$
740 FOR J=1 TO N
750 PRINT#1,I$(J)
760 PRINT #1,REF(J)
770 NEXT J:CLOSE#1
780 RETURN
790 :REMARK error trap
800 IF ERR=53 AND ERL=160 THEN PRINT"None":PRINT: \n    PRINT"Hit <RETURN> to continue...";:X$=INPUT$(1):PRINT ER$:LOAD"MENU",R
810 IF ERR=63 AND ERL=670 THEN N=J-1:J=11:RESUME 700
820 IF ERR=53 AND ERL=490 THEN RESUME 630
830 IF ERR=53 AND ERL=900 THEN RESUME 910
840 ON ERROR GOTO 0
850 :REMARK delete
860 PRINT FNC$(22,1);J1$;"Delete which route?  <EXIT>  ";J$; \n     STRING$(2,95);K$;
870 LINE INPUT X$:IF X$="" THEN 260
880 X=VAL(X$):IF X>M OR X<=0 THEN PRINT BL$:GOTO860
890 RT$=RT$(X):IF ASC(RT$)<65 OR ASC(RT$)>90 THEN RT$="X"+RT$
900 KILL"SY1:"+RT$
910 IF M=1 THEN KILL"SY1:ROUTINGS.DAT":GOTO 10
920 IF X<>M THEN FOR J=X+1 TO M:RT$(J-1)=RT$(J):NEXT J
930 RT$(M)="":M=M-1
940 OPEN"O",1,"SY1:ROUTINGS.DAT"
950 PRINT #1,M
960 FOR J=1 TO M:PRINT #1,RT$(J)
970 NEXT J:CLOSE
980 GOTO10
990 END
