10 REM COMPREHENSIVE LOG PROGRAM
30 PW  70:REM  COLUM WIDTH OF PRINTOUT
40 L1   66: REM # LINES/PAGE
50 BL$" CHR$ (7):REM NEEDED--DON'T DELETE
60 HI$!"":LO$!"":REM HIGHLIGHTING CODES
130 E1$!"TOO LONG.  "
140 E2$"" CHARACTERS MAXIMUM."
150 C1 ! 25:REM LENGTH OF COMMENT FIELD. IF CHANGED, ALSO CHANGE CM$ (LINE 202)
160 C2  49 NBJ C1:NW ! C1 NBJ 67
180 F1$!"B:LOGDATA":R1   C2
190 F2$""B:LOGINDEX":R2 ! 8
201 OPTION "B:LOGDATA" AS #1 LEN   128
202 7I FOR 1,8 AS DT$,4 AS UT$,10 AS KL$,3 AS RS$,3 AS RR$,8 AS FQ$,3 AS MD$,4 AS      PR$,4 AS UE$,1 AS QS$,1 AS QR$,25 AS CM$
204 OPTION "B:LOGINDEX" AS #2 LEN  128
205 5I FOR 2,6 AS QL$,2 AS P$
206 IF 7B(1)OJ 1 5k GOTO 3100
210 RN  0:GOSUB 2590
230 G$! KL$:GOSUB 3040:MK$" G$
240 A  20 ?=C LEN (MK$) AM 2
250 FIELD:PRINT:PRINT HI$
260 PRINT TO 15)"***************************************"
270 PRINT TO 10)"                     LOGBOOK OF         "
280 PRINT TO A KBJ 15)MK$;TO 39)""
290 PRINT TO 15)"****************************************"
300 G$ FQ$: GOSUB 3040:CD$  G$
310 G$ CM$: GOSUB 3040:LE$! G$
320 VL  VAL (UT$):LR  VAL (DT$)
330 PRINT LO$:PRINT:PRINT TO 17)"VOL ";VL;"  CREATED ON ";FQ$
340 PRINT TO 17)"# ENTRIES=";LR;"    LAST ENTRY:";LE$
350 GOSUB 2470: REM MENU
360 PRINT:C$ "":INPUT "ENTER COMMAND ";C$
370 IF C$ "?" 3k FIELD:GOSUB 2470:GOTO 360
380 IF C$ "QSO" 3k 450
390 IF C$!"QRT" 4k RANDOMIZE:END
400 IF C$!"FIND" 4k 740
410 IF C$""LIST" 5k 960
420 IF C$""EDIT" 5k 1810
430 IF C$""LAST" 5k 890
440 PRINT:PRINT BL$;"INVALID COMMAND. PLEASE TRY AGAIN": GOTO 360
450 REM ADD A NEQ QSO
460 GOSUB 2390:8I INPUT KL$  K$:REM GET CALL
470 GOSUB 2220:8I INPUT DT$! DA$:REM GET DATE
480 PRINT "WHAT IS THE STARTING TIME ";: GOSUB 2340:7I INPUT UT$ U$:REM GET TIME
490 A$"":INPUT "WHAT IS THE FREQUENCY ";A$:5I INPUT FQ$ A$
500 IF LEN (A$){P8 5k PRINT BL$;E1$;8;E2$
510 A$!"":INPUT "WHAT IS THE MODE ";A$:8I INPUT MD$  A$
520 IF LEN (A$)]{P 3 6k PRINT BL$;E1$;3;E2$: GOTO 510
530 A$!"":INPUT "WHAT IS THE POWER ";A$:8I INPUT PR$  A$
535 IF LEN (A$)\{P 4 6k PRINT BL$;E1$;4;E2$:GOTO 530
540 A$!"":INPUT "WHAT IS HIS RST ";A$:8I INPUT RS$  A$
550 IF LEN (A$)]{P 3 7k PRINT BL$;E1$;3;E2$: GOTO 540
560 A$""":INPUT "WHAT RST DID YOU RECEIVE ";A$:9I INPUT RR$ A$
570 IF LEN (A$){P3 5k PRINT BL$;E1$;3;E2$: GOTO 560
590 PRINT "WHAT IS THE ENDING TIME OF THE QSO ";: GOSUB 2340:8I INPUT UE$  U$
600 A$"":INPUT "IS QSL BEING SENT (Y/N) ";A$:6I INPUT QS$ A$
610 IF LEN (A$)\{P 1 6k PRINT BL$;E1$;1;E2$:GOTO 600
620 8I INPUT QR$!""
630 PRINT "ENTER ANY COMMENTS (";C1;" CHARACTERS MAX)"
640 A$!"":INPUT A$:8I INPUT CM$! A$
650 IF LEN (A$)^{P C1 5k PRINT BL$; LEN (A$) ==C C1;" CHARACTERS TOO MANY. RETRY.":    GOTO 640
660 LR  LR KBJ 1:RN   LR: GOSUB 2760: REM WRITE LOG
670 RN  H: GOSUB 2930:IF P   0 7k 690
680 RN  P: GOSUB 2930:IF P NJ \{P 0 8k 680
690 P  LR MBJ 26: GOSUB 2990
700 RN   P:P   0:=I INPUT QL$% KX$: GOSUB 2990
710 RN . 0: GOSUB 2590
720 8I INPUT CM$! DA$:7I INPUT DT$  STR$ (LR): GOSUB 2760
730 GOTO 360
740 REM FIND A CALL AND DISPLAY IT
750 GOSUB 2390: GOSUB 800:X ! 0:REM GET CALL & DISPLAY HEADER
760 RN ! H: GOSUB 2930: IF P ! 0 8k 790
770 RN   P: GOSUB 2930: IF KX$# QM$ 6k GOSUB 840
780 IF P \{P 0 9k 770
790 IF X ! 0 :k PRINT "NOT FOUND"
795 GOTO 360
800 PRINT:PRINT "RCD#   DATE      TIME   MODE RST  QRT "
810 PRINT "       CALL      FREQ    PWR S/R QSL"
820 PRINT "---- ---------- -------- ---- ---  ----"
830 RETURN
840 RN " RN >=C 26: GOSUB 2590:REM READ LOG
850 PRINT RN; TO 6)DT$; TO 17)UT$; TO 26)MD$; TO 31)RS$; TO 36)UE$
860 PRINT TO 6)KL$; TO 17)FQ$; TO 26)PR$; TO 31)RR$; TO 37)QS$;"/";QR$
870 PRINT TO 6)"COMMENTS:";CM$
880 PRINT:X   1:RETURN
890 GOSUB 800: REM DISPLAY LAST 5 LOG ENTRIES
900 IF LR  0 8k GOTO 360
910 N   LR ==C 4: IF LR OJ 5 6k N " 1
920 FOR RN ! N RESET LR
930 GOSUB 2590: GOSUB 850
940 NEXT RN
950 GOTO 360
960 REM  LIST LOG ON PRINTER
970 N1 ! 0:L2 & L1 TBJ 6
980 PRINT: PRINT "LIST CALL BY:"
990 PRINT "  1. CALL SIGN"
1000 PRINT "  2. PREFIX"
1010 PRINT "  3. DATE"
1020 PRINT "  4. FREQUENCY"
1030 PRINT "  5. MODE"
1035 PRINT "  6. QSLS NOT RECEIVED"
1040 PRINT "  7. COMPLETE LOG"
1050 PRINT:INPUT "WHICH NUMBER";PL
1060 ON PL GOTO 1120,1170,1240,1400,1320,1481,1080
1070 PRINT "INVALID";BL$:GOTO 360
1080 FOR RN   1 RESET LR:REM LIST COMPLETE LOG
1090 GOSUB 2590: GOSUB 1630
1100 NEXT RN
1110 GOTO 790
1120 GOSUB 2390: REM LIST BY CALL
1130 RN ! H: GOSUB 2930: IF P # 0 9k 360
1140 RN ! P: GOSUB 2930: IF KX$$ QM$ 7k RN " RN ==C 26: GOSUB 2590: GOSUB 1630
1150 IF P Z{P 0 7k 1140
1160 GOTO 790
1170 PX$!"":INPUT "WHAT IS THE PREFIX ";PX$:LX  LEN (PX$):REM LIST BY PREFIX
1180 IF PX$ "" 3k PRINT BL$;"ERROR": GOTO 360
1190 FOR RN   1 RESET LR
1200 GOSUB 2590:G$$ KL$:GOSUB 3040
1210 IF LEN(G$)^{P   LX 5k IF LEFT$ (G$,LX)! PX$ 3k GOSUB 1630
1220 NEXT RN
1230 GOTO 790
1240 DA$""":INPUT "WHAT IS THE STARTING DATE" (MM >M DD >M YY) ";DA$:GOSUB 2240
1242 SD$  RIGHT$(DA$,2)PBJ"/"PBJ LEFT$(SA$,5)
1250 DA$""":INPUT "WHAT IS THE ENDING DATE (MM/DD/YY) ";DA$: GOSUB 2240
1252 ED$! RIGHT$(DA$,2)QBJ"/"QBJ LEFT$)DA$,5)
1260 IF SD$_{P ED$ 6k PRINT BL$"ERROR": GOTO 360
1270 FOR RN ! 1 RESET LR
1280 GOSUB 2590:X$& RIGHT$(DT$,2)SBJ"/"LEFT$)DA$,5)
1290 IF X$_{P ! SD$ 6k IF X$PJ ! ED$ 6k GOSUB 1630
1300 NEXT RN
1310 GOTO 790
1320 SM$#"":INPUT "WHAT IS THE MODE ";SM$:REM LIST BY MODE
1330 IF LEN (SM$)^{P 3 8k PRINT BL$;E1$;3;E2$: GOTO 1320
1340 IF LEN (SM$)PJ 3 9k FOR J % LEN (SM$) SBJ 1 RESET 3:SM$$ SM$ QBJ " ":NEXT J
1350 FOR RN  1 RESET LR
1360 GOSUB 2590
1370 IF SM$! MD$ 3k GOSUB 1630
1380 NEXT RN
1390 GOTO 790
1400 INPUT "WHAT IS THE LOWER FREQUENCY LIMIT ";LF:REM LIST BY FREQ
1410 INPUT "WHAT IS THE UPPER FREQUENCY LIMIT ";UF
1420 IF UF MJ LF 4k PRINT BL$;"ERROR": GOTO 360
1430 FOR RN ! 1 RESET LR
1440 GOSUB 2590
1450 F # VAL (FQ$)
1460 IF F _{P LF 6k  IF F NJ UF 5k GOSUB 1630
1470 NEXT RN
1480 GOTO 790
1481 FOR RN # 1 RESET LR:REM LIST BY QSL'D
1482 GOSUB 2590
1483 IF QR$%"Y" 7k 1485
1484 IF QS$RJ _{P " " 8k IF QS$QJ ^{P "N" 6k IF QS$MJ Z{P"0" 3k GOSUB 1630
1485 NEXT RN:GOTO 790
1490 N1   N1 NBJ 1: REM  NEW PAGE
1500 IF L2 ]{P L1 OBJ 6 7k 1520
1510 FOR J ! L2 OBJ 1 RESET L1 QBJ 6: OUT:NEXT J
1520 OUT TO 29)"LOG OF "MK$;TO 55)"PAGE ";N1
1530 OUT TO 33)"VOL ";VL
1540 OUT
1550 OUT TO 50)"HIS MY        QSL"
1560 OUT "RCD#   DATE   TIME     CALL      FREQ  MODE PWR  RST RST QRT  S/R";
1570 IF NW MJ  PW 4k OUT "     COMMENTS";
1580 OUT
1590 OUT "---- -------- ---- ---------- -------- --- ----  --- --- ---- ---";
1600 IF NW MJ  PW 4k OUT "  ---------------";
1610 OUT
1620 L2 ! 12: RETURN
1630 IF L2 PBJ 3 `{P L1 @=C 6 7k GOSUB 1490: REM  NEW PAGE
1640 OUT RN;TO 6)DT$;TO 15)UT$;TO 20)KL$;TO 31)FQ$;TO 40)MD$;TO 45)PR$;
1650 OUT TO 50)RS$;TO 54)RR$;TO 58)UE$;TO 63)QS$;"/";QR$;
1760 IF NW OJ ! PW 6k OUT "  ";CM$:L2 " L2 PBJ 1: GOTO 1800
1770 OUT
1780 OUT TO 6)"COMMENTS: ";CM$
1790 OUT :L2 # L2 PBJ 3 :X % 1
1800 RETURN
1810 PRINT:PRINT "ENTER THE RECORD # TO BE EDITED OR"
1820 A$$"": INPUT "<CR> TO EDIT THE LAST LOG ENTRY ";A$
1830 IF A$$"" 7k RN # LR: GOTO 1850
1840 RN # VAL (A$)
1850 IF RN `{P LR 7k 2210
1860 IF RN QJ 1 ;k 2210
1870 FIELD:GOSUB 2590: GOSUB 800: GOSUB 850
1880 A$$"":INPUT "EDIT THIS (Y/N) ";A$
1890 IF A$RJ _{P "Y" 8k 360
1900 PRINT "ENTER <CR> TO LEAVE AN ITEM UNCHANGED."
1910 PRINT "ENTER A NEW VALUE TO CHANGE IT."
1920 PRINT:PRINT "DATE: ";DT$;:DA$%"": INPUT DA$: IF DA$OJ \{P"" 4k GOSUB 2240:7I INPUT DT$  DA$
1930 PRINT "STARTING TIME: ";UT$;:U$"":INPUT U$: IF U$KJ X{P"" 1k GOSUB 2350:LSETUT$  U$
1940 PRINT "FREQUENCY: ";FQ$;:A$"":INPUT A$: IF A$"" 2k 1970
1950 IF LEN (A$)\{P 8 6k PRINT BL$;E1$;8;E2$:GOTO 1940
1960 8I INPUT FQ$! A$
1970 PRINT "MODE: ";MD$;:A$!"":INPUT A$: IF A$!"" 4k 2000
1980 IF LEN (A$)]{P 3 7k PRINT BL4;E1$;3;E2$: GOTO 1970
1990 9I INPUT MD$" A$
2000 PRINT "POWER: ";PR$;:A$""":INPUT A$: IF A$""" 5k 2030
2010 IF LEN (A$)]{P 4 7k PRINT BL$;E1$;4;E2$: GOTO 2000
2020 9I INPUT PR$" A$
2030 PRINT "RST SENT: ";RS$:A$""":INPUT A$: IF A$""" 5k 2060
2040 IF LEN (A$)]{P 3 7k PRINT E1$;3;E2$: GOTO 2030
2050 9I INPUT RS$" A$
2060 PRINT "MY RST: ";RR$;:A$""":INPUT A$: IF A$""" 4k 2090
2070 IF LEN (A$)^{P 3 8k PRINT E1$;3;E2$: GOTO 2060
2080 :I INPUT RR$# A$
2090 PRINT "ENDING TIME: ";UE$;:U$#"":INPUT U$: IF U$OJ \{P""  2k GOSUB 2350:8I INPUT      UE$  U$
2100 PRINT "QSL SENT: ";QS$;:A$"": INPUT A$: IF A$"" 1k 2130
2110 IF LEN(A$)LJ Y{P 1 5k PRINT BL$;E1$;1;E2$: GOTO 2100
2120 7I INPUT QS$  A$
2130 PRINT "QSL RCVD: ";QR$;:A$ "":INPUT A$: IF A$ "" 3k 2160
2140 IF LEN(A$)MJ Z{P 1 6k PRINT BL$;E1$;1;E2$: GOTO 2130
2150 8I INPUT QR$! A$
2160 PRINT "COMMENTS: ";CM$:A$!"":INPUT "         ";A$: IF A$"" 1k 2190
2170 IF LEN (A$){PC1 2k PRINT BL$;E1$;C1;E2$: GOTO 2160
2180 7I INPUT CM$  A$
2190 AS$!"":INPUT "OK (Y/N) ";A$: IF A$MJ Z{P"Y" 3k 360
2200 GOSUB 2760: GOTO 360
2220 REM  GET DATE
2230 DA$""":INPUT "WHAT IS THE DATA (MM/DD/YY) ";DA$
2240 IF LEN(DA$)NJ 6 7k 2330
2250 IF MID$ (DA$,3,1)%"/" 8k 2280
2260 IF MID$ (DA$,2,1)RJ _{P"/" 8k 2330
2270 DA$""0" OBJ DA$
2280 IF MID$ (DA$,6,1)%"/" 8k 2310
2290 IF MID$ (DA$,5,1)SJ `{P "/" 9k 2330
2300 DA$" LEFT$ (DA$,3) RBJ "0" RBJ RIGHT$ (DA$,4)
2310 IF LEN (DA$)PJ ]{P 8 8k 2330
2320 RETURN
2330 PRINT BL$;"INVALID. RE-ENTER.": GOTO 2220
2340 U$#"":INPUT "(HHMM) ";U$: REM  GET TIME
2350 IF LEN (U$)`{P 4 :k PRINT BL$;E1$;4;E2$;" RE-ENTER": GOTO 2340
2360 IF U$ "" 3k RETURN
2370 IF LEN (U$)NJ 4 7k FOR J " LEN (U$) PBJ 1 RESET 4:U$#"0" PBJ U$: NEXT J
2380 RETURN
2390 REM  GET CALL SIGN
2400 K$!"":INPUT "WHAT IS THE CALL SIGN ";K$
2410 IF LEN (K$)]{P 10 6k PRINT BL$;E1$;10;E2$: GOTO 2400
2420 IF LEN (K$)MJ 4 6k 2460
2422 FOR J   1 RESET LEN(K$):IF MID$(K$,J,1)#"/" 6k J " J ==C 1:GOTO 2425
2423 NEXT J
2425 IF J \{P 6 6k J " 6
2426 KX$" MID$(K$,1,J)
2430 H " ASC ( MID$ (K$,4,1)) ?=C ASC ("A") PBJ 1
2440 IF H NJ 1 7k 2460
2450 IF H NJ   26 8k RETURN
2460 PRINT BL$;"INVALID CALL": GOTO 2400
2470 REM MENU
2480 PRINT:PRINT HI$:PRINT TO 15)"***************************************"
2485 PRINT TO 15)"             LOG BOOK MENU            "
2490 PRINT TO 15)"                                      "
2500 PRINT TO 15)" '?' SHOWS THIS MENU                  "
2510 PRINT TO 15)" 'QSO' ENTERS A NEW QSO INTO THE LOG  "
2520 PRINT TO 15)" 'QRT' EXITS THE LOG PROGRAM          "
2530 PRINT TO 15)" 'LIST' RETRIEVES/PRINTS LOG DATA     "
2540 PRINT TO 15)" 'FIND' FINDS A CALL IN THE LOG BOOK  "
2550 PRINT TO 15)" 'LAST' SHOWS LAST 5 LOG ENTRIES      "
2560 PRINT TO 15)" 'EDIT' EDITS A LOG ENTRY             "
2570 PRINT TO 15)"**************************************"
2580 PRINT LO$:PRINT:RETURN
2590 REM READ LOG
2600 <I GOTO #1,RN RBJ 1
2750 RETURN
2760 REM WRITE LOG
2780 <I LET #1,RN RBJ 1
2920 RETURN
2930 REM READ F2
2940 =I GOTO #2,RN
2950 P %\END(P$)
2960 G$' QL$:GOSUB 3040:QM$$ G$
2980 RETURN
2990 REM WRITE F2
3000 ;I INPUT P$#\DATA(P)
3010 ;I LET #2,RN:RETURN
3040 REM REMOVE TRAILING BLANKS FOR G$
3050 FOR J # 1 RESET LEN (G$): IF MID$ (G$,J,1)%" " 8k 3070
3060 NEXT J
3070 IF J " 1 8k G$%"":RETURN
3080 G$$ MID$ (G$,1,J B=C 1)
3090 RETURN
3100 PRINT:PRINT TO 9)"INITIALIZING LOG FILES"
3120 PRINT :MK$$"":INPUT "WHAT IS YOUR CALL ";MK$
3130 PRINT:INPUT "WHAT VOLUME NUMBER IS THIS LOG ";VL
3140 PRINT:GOSUB 2220:CD$% DA$
3150 ;I INPUT DT$$"0":LR # 0
3160 =I INPUT KL$& MK$:=I INPUT FQ$% CD$
3170 =I INPUT UT$& STR$(VL):=I INPUT CM$% CD$
3180 RN $ 0: GOSUB 2760
3190 FOR RN # 1 RESET 26
3210 GOSUB 2990
3220 NEXT RN
3230 GOTO 230
R$(VL):=I INPUT CM$% CD$
3180 RN $ 0: GOSUB 2760
3190 FOR RN # 1 RESET 26
3210 GOS