home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
HAMRADIO
/
LIST-LOG.LBR
/
HAMLOG.BQS
/
HAмлOG.BAS
Wrap
BASIC Source File
|
2000-06-30
|
12KB
|
375 lines
10 '**VARIABLES**
20 '
30 'B$,D$,E$,F$,N$,W$,Y$
40 'NN$,TH$,TM$,DA$,XO$,YR$
45 'FLX$,FXL$
50 'TH,TM,DA,XO,YR,C,D,M,S
55 'FLN$ = FILENAME
60 'YN$ = TEMP STRING, USE ANYTIME
70 'NN$ = INPUT
80 'DT$ = DATE STRING (YY/MM/DD)
90 'LXT = LENGTH OF EXTENSION
100 'FTL$= FILE TO LOAD
110 '
120 '********************DEFINES********************
130 O$="WB6CGW" 'OPERATOR - PUT YOUR CALL HERE
140 BS$="7100" 'BAND - PUT YOUR BAND HERE
150 S$=" ," 'SPACE+,
155 P$=STRING$(14,42) '*$
157 WT$=" WAIT"
158 CG$="COLLECT GARBAGE"
160 C=1 'Contact NUMBER
170 DEFSTR M
175 LMX=600
180 EXT$="000"
190 I=1 'CONTACT #
200 JG= -1 'FOR JG COMMUNICATIONS CLOCK
210 DP= -1 'DUPLICATE
220 CLS$=CHR$(26)'clear screen char
230 BKS$=CHR$(8) 'backspace char
235 BEL$=CHR$(7) 'console bell
240 CO=0
245 Y$="0" 'time string
1000 '*****START PROGRAM*****
1100 PRINT CLS$
1200 PRINT TAB(5) "AMATEUR RADIO LOGGING PROGRAM"
1400 PRINT
1500 PRINT TAB(11) "MARCH 1986 WB6CGW"
1600 GOSUB 36000
1900 GOSUB 36000:PRINT "ENTER DATE: (YY/MM/DD) ";
2000 INPUT DT$
2100 IF DT$="" THEN GOTO 2400
2150 DT$=" "+DT$
2300 GOTO 2650
2400 PRINT WT$:GOSUB 20300
2500 IF Y$="0" THEN GOSUB 36000:PRINT "CLOCK NOT INSTALLED":GOTO 1900
2600 DT$=DTE$
2650 GOSUB 19700
2652 CO=0
2655 GOSUB 9910
2660 PRINT:PRINT "DATE:";DT$
2665 PRINT:PRINT:PRINT "OK ? ";
2670 GOSUB 28000
2680 IF YN=(-1) THEN C=C-1:CO=CO-1: GOSUB 9500
2690 PRINT CLS$
2700 GOSUB 36000
2750 FLN$="LG"+MID$(DT$,2,2)+MID$(DT$,5,2)+MID$(DT$,8)+"."+EXT$
2800 PRINT O$" ON "BS$" - (enter '?' FOR HELP)"
2900 GOSUB 20300
3000 IF Y$="0" GOTO 3200
3100 PRINT:PRINT "TIME: "Y$
3200 PRINT:PRINT "LOG ENTRY #"C" ENTER <CR> FOR MENU"
3202 PRINT "CONTACT #"C-CO" "FRE(0)" BYTES FREE"
3210 IF FRE(0) < 1000 THEN GOSUB 37000
3300 PRINT:INPUT; "CALL: ";N$
3400 IF N$="M" OR N$="m" OR N$="" THEN GOTO 7400
3500 IF N$= "C" OR N$= "c" THEN GOSUB 22700:GOTO 2700
3600 IF N$= "D" OR N$= "d" THEN GOSUB 22800:GOTO 2700
3700 IF N$="?" OR N$="'?'" THEN GOSUB 23000:GOTO 2700
3800 IF DP=1 GOTO 4500
3900 FOR I = 1 TO C
4000 IF N$ = M(I,1) THEN GOTO 4300
4100 NEXT I
4200 GOTO 4500
4300 GOSUB 36000:PRINT P$;" DUPLICATE #"I;P$
4400 GOTO 3200
4500 PRINT " RST: ? ";
4600 FOR N=1 TO 3
4700 YN$=INPUT$(1)
4800 PRINT YN$;
4900 W$(N)=YN$
5000 IF YN$=BKS$ THEN N=N-2
5100 IF N<1 THEN PRINT: GOTO 4500
5200 NEXT
5300 W$=W$(1)+W$(2)+W$(3)
5400 PRINT " TIME: ";
5500 GOSUB 20300
5600 IF Y$="0" THEN GOTO 5700 ELSE GOTO 6600
5700 FOR N=1 TO 4
5800 YN$=INPUT$(1)
5900 PRINT YN$;
6000 Y$(N)=YN$
6100 IF YN$=BKS$ THEN N=N-2
6200 IF N<1 THEN PRINT: GOTO 5400
6300 NEXT
6400 Y$=Y$(1)+Y$(2)+Y$(3)+Y$(4)
6500 GOTO 6605
6600 PRINT Y$
6605 PRINT:PRINT
6610 LINE INPUT "COMMENT:";CT$
6700 GOSUB 36000:PRINT "ENTRY #"C" OK ";
6710 GOSUB 28000
6800 IF YN=(-1) GOTO 3200
6900 PRINT:PRINT
7000 M(C,1)=N$
7100 M(C,2)=W$+S$+Y$+S$+CT$
7200 C=C+1
7300 GOTO 7500
7400 GOSUB 7700
7500 GOTO 2900
7600 '*****MAIN MENU********************************
7700 GOSUB 36000:PRINT (C-1)-CO "CONTACTS -"C-1"ENTRIES IN LOG -"FRE(0)"BYTES FREE-"
7710 ON ERROR GOTO 19270
7720 IF FRE(0) < 1000 THEN GOSUB 36000:GOSUB 37000
7750 PRINT:PRINT:PRINT TAB(3) "-MENU:"
7800 PRINT
7900 PRINT TAB(5) "1 - CREATE LOG 6 - CHANGE OPERATOR/BAND"
8000 PRINT TAB(5) "2 - VIEW LOG 7 - ERASE LOG"
8100 PRINT TAB(5) "3 - EDIT LOG 8 - READ LOG FROM DISK"
8200 PRINT TAB(5) "4 - SEARCH CALL 9 - WRITE LOG TO DISK"
8300 PRINT TAB(5) "5 - CHANGE DISKS 0 - EXIT TO BASIC"
8400 PRINT SPC(24)"G - "CG$
8410 PRINT "CHOICE: ? ";
8500 A$=INPUT$(1)
8600 PRINT A$
8650 IF A$=CHR$(&H30) THEN GOSUB 20100
8660 IF A$="G" OR A$="g" THEN GOSUB 37000
8700 A=VAL(A$)
8800 ON A GOSUB 9100,10500,12000,30000,35000,9500,19300,17300,15100
8850 IF A=99 GOTO 7700
8900 IF A > 9 OR A < 1 THEN GOTO 9200
9000 IF A <> 1 GOTO 7700
9100 RETURN
9200 PRINT " ENTER 1 - 9"
9300 GOTO 8500
9400 '*****CHANGE CONTROL OPERATOR*****
9500 PRINT CLS$:PRINT:INPUT "WHAT IS YOUR CALL AS CONTROL OP";YN$
9600 IF YN$="" THEN O$=O$ ELSE O$=YN$
9700 GOSUB 36000:PRINT O$ " LOGGED ON"
9800 PRINT:PRINT: INPUT "ENTER BAND";YN$
9900 IF YN$="" THEN BS$=BS$ ELSE BS$=YN$
9910 IF Y$="0" THEN INPUT "ENTER TIME";Y$
10000 PRINT:PRINT "operator "O$" logged on "BS$" Khz at "Y$
10100 M(C,1)="-"+DT$+" "+Y$+" -":M(C,2)="- "+O$+S$+"ON "+BS$+" Khz -"
10200 C=C+1
10250 CO=CO+1
10260 GOSUB 20300
10300 RETURN
10400 '***** VIEW LOG *****
10500 PRINT CLS$:INPUT "STARTING AT WHAT CONTACT #";K
10600 IF K<1 OR K> LMX THEN K=1
10800 PRINT CLS$
11060 PRINT:PRINT
11100 FOR I=K TO K+19
11300 IF I < 10 THEN PRINT " ";I;
11400 IF I > 9 AND I < 100 THEN PRINT " ";I;
11500 IF I > 99 THEN PRINT I;
11600 PRINT TAB(7);M(I,1);TAB(26);M(I,2)
11700 NEXT I
11750 PRINT "MORE ? <CR> CONTINUES ";
11760 GOSUB 28000
11770 IF YN=1 OR YN=0 THEN K=K+20:PRINT:GOTO 11100
11800 RETURN
11900 '***** EDIT LOG **************
12000 PRINT CLS$:PRINT "EDIT LOG"
12100 INPUT "CHANGE LOG ENTRY #";L
12110 IF L<1 OR L> LMX THEN L=1
12115 GOSUB 36000:PRINT "EDIT ENTRY #"L
12200 PRINT:PRINT M(L,1)
12210 PRINT M(L,2)
12215 IF M(L,1)="" THEN PRINT:PRINT:PRINT "ENTRY #"L"BLANK":GOTO 14900
12300 PRINT
12310 PRINT:PRINT "RE-ENTER ITEM or <CR> no change or * TO DELETE"
12400 PRINT:PRINT " "; M(L,1)
12402 INPUT N$
12410 IF N$=CHR$(42) THEN N$="*"+M(L,1):NN$=M(L,2):PRINT:PRINT:PRINT "DELETED":GOTO 14000
12500 IF N$="" THEN N$=M(L,1)
12600 GOSUB 36000
12610 IF LEFT$(N$,1)="-" THEN GOTO 13900
12700 PRINT " ";LEFT$(M(L,2),3)
12710 INPUT W$
12800 IF W$="" THEN W$=LEFT$(M(L,2),3)
12900 PRINT
13000 PRINT " ";MID$(M(L,2),6,4)
13010 INPUT Y$
13100 IF Y$="" THEN Y$=MID$(M(L,2),6,4)
13200 PRINT
13300 PRINT " "; MID$(M(L,2),12)
13310 INPUT B$
13400 IF B$="" THEN B$=MID$(M(L,2),12)
13410 NN$=W$+S$+Y$+S$+B$
13500 GOTO 14000
13900 PRINT:PRINT M(L,2)
13910 LINE INPUT NN$
13920 IF NN$="" THEN NN$=M(L,2)
14000 PRINT:PRINT:PRINT N$
14010 PRINT NN$
14100 PRINT:PRINT
14200 PRINT "ENTRY #"L" OK ? <CR> ACCEPT AND CONTINUE";
14210 GOSUB 28000
14300 IF YN=1 OR YN=0 GOTO 14700
14400 IF YN=(-1) THEN GOSUB 36000:GOTO 12115
14410 PRINT:PRINT "ENTER Y/N";
14420 GOTO 14210
14700 M(L,1)=N$
14800 M(L,2)=NN$
14810 IF YN=0 THEN L=L+1:PRINT:GOTO 12115
14900 RETURN
15000 '***** SAVE LOG ROUTINE *****
15100 ON ERROR GOTO 19000
15102 GOSUB 36000:PRINT "SAVE WITH DATE ";DT$;:GOSUB 28000
15104 IF YN=0 THEN GOTO 17100
15106 IF YN=-1 THEN GOTO 15110
15108 IF YN=1 THEN GOTO 15200
15109 GOTO 17100
15110 GOSUB 36000:PRINT "ENTER FILENAME TO SAVE:"
15120 INPUT " <CR> RETURNS TO MENU";FXN$
15130 IF FXN$="" THEN GOTO 17100
15185 ON ERROR GOTO 19260
15186 KILL FXN$+".BAK"
15187 NAME FXN$ AS FXN$+".BAK"
15188 ON ERROR GOTO 19100
15190 FLX$=FXN$
15195 GOTO 16410
15200 NAME FLN$ AS FLN$
15300 EXT$=MID$(FLN$,10)
15400 FLN$=LEFT$(FLN$,9)
15500 EXT=VAL(EXT$)
15600 EXT=EXT+1
15700 EXT$=STR$(EXT)
15800 EXT$=MID$(EXT$,2)
15900 LXT=LEN(EXT$)
16000 FOR YN=1 TO 3-LXT
16100 EXT$="0"+EXT$:NEXT
16200 FLN$=FLN$+EXT$
16300 GOTO 15200
16400 FLX$=FLN$
16410 GOSUB 36000:PRINT FLX$
16500 OPEN "O",#1,FLX$
16600 FOR I=1 TO ( C - 1 )
16650 IF LEFT$(M(I,1),1)=CHR$(42) GOTO 16800
16700 PRINT #1,M(I,1);" ,";CHR$(34);M(I,2);CHR$(34)
16800 NEXT I
16900 CLOSE#1
17000 PRINT "DATA SENT TO DISK"
17100 RETURN
17200 '***** LOAD FILE ROUTINE **********************
17300 GOSUB 36000:PRINT "ENTER NAME OF FILE TO LOAD:"
17310 INPUT " <CR> RETURNS TO MENU ";FTL$
17400 IF FTL$="" THEN GOTO 18600
17500 PRINT FTL$ " LOADING"
17600 ON ERROR GOTO 18800
17700 OPEN "I",#1,FTL$
17800 I=C
17900 INPUT #1,M(I,1),M(I,2)
17910 IF LEFT$(M(I,1),1)="-" THEN CO=CO+1
18000 I=I+1
18100 IF M(I,1)= "0" AND M(I,2)= "0" THEN 18400
18200 IF EOF(1) THEN 18400
18300 GOTO 17900
18400 CLOSE
18500 C=I
18600 RETURN
18700 '***** OPEN FILE ERROR ROUTINES *****
18800 GOSUB 36000:PRINT "ERROR # " ERR
18810 IF ERR=53 THEN PRINT "FILE NOT ON DISK":CLOSE
18820 IF ERR=62 THEN PRINT "NO DATA IN FILE":CLOSE
18900 RESUME 17300
18999 '***** SAVE FILE ERROR ROUTINES *****
19000 GOSUB 36000
19010 IF ERR=53 THEN PRINT:PRINT FLN$" NOT FOUND":RESUME 16400
19100 IF ERR=58 THEN PRINT:PRINT FLN$" EXISTS":RESUME 15300
19110 IF ERR=64 THEN PRINT:PRINT "BAD FILENAME":RESUME 15100
19120 IF ERR=53 THEN FLX$=FXN$:RESUME 16410
19200 PRINT "ERROR # "ERR
19250 RESUME 17100
19260 RESUME NEXT
19270 GOSUB 36000:PRINT P$;"ERROR #"ERR;" LOG MAY BE LOST"P$;BEL$
19280 PRINT:PRINT P$;"SAVE LOG TO DISK NOW! ";P$:RESUME 7700
19300 PRINT:PRINT "ERASE LOG":PRINT "ARE YOU SURE ?";
19400 GOSUB 28000
19500 IF YN=1 GOTO 19600 ELSE RETURN
19600 ERASE M
19700 DIM M(LMX,2)
19800 C=1:CO=0
19900 PRINT CLS$:PRINT:PRINT "LOG ERASED "FRE(X$)" BYTES FREE"
19910 PRINT:PRINT
20000 RETURN
20100 GOSUB 36000:PRINT "EXIT TO BASIC AND DELETE LOG IN MEMORY"
20110 PRINT "ARE YOU SURE ?"
20120 GOSUB 28000
20130 IF YN=1 GOTO 20150
20135 A$="99"
20140 RETURN
20150 ON ERROR GOTO 0
20160 END
20200 '***** CLOCK ROUTINES FOR OSBORNE W/JG CLOCK****
20300 IF JG=(-1) THEN ADDR=PEEK(&H40)+256*PEEK(&H41) ELSE Y$="0":GOTO 22500
20400 IF ADDR > 61000! THEN Y$="0":GOTO 22500
20500 FOR N=ADDR+19 TO ADDR+50
20510 IF PEEK(N)=0 THEN 20550 ELSE NEXT
20550 IF PEEK(N-3)=&H39 AND PEEK(N-4)=&H31 THEN GOTO 20600
20560 Y$="0":GOTO 22500
20600 TH=PEEK(ADDR+3)
20700 TM=PEEK(ADDR+4)
20800 TH$=STR$(TH):TM$=STR$(TM)
20900 IF VAL(TH$) < 10 THEN TH$="0"+RIGHT$(TH$,1) ELSE TH$=RIGHT$(TH$,2)
21000 IF VAL(TM$) < 10 THEN TM$="0"+RIGHT$(TM$,1) ELSE TM$=RIGHT$(TM$,2)
21100 Y$=TH$+TM$
21200 DA=PEEK(ADDR)
21300 XO=PEEK(ADDR+1)
21350 YR=PEEK(ADDR+2)
22100 DA$=STR$(DA):XO$=STR$(XO):YR$=STR$(YR)
22200 IF VAL(DA$) < 10 THEN DA$="0"+RIGHT$(DA$,1) ELSE DA$=RIGHT$(DA$,2)
22300 IF VAL(XO$) < 10 THEN XO$="0"+RIGHT$(XO$,1) ELSE XO$=RIGHT$(XO$,2)
22400 DTE$=YR$+"/"+XO$+"/"+DA$
22500 RETURN
22600 '*****TOGGLE ROUTINES**********
22700 JG=JG*(-1):RETURN
22800 DP=DP*(-1):RETURN
22900 '***** HELP MENU***************
23000 GOSUB 36000
23200 PRINT CLS$:PRINT:PRINT P$;"MENU";P$
23300 PRINT " C TO TOGGLE CLOCK
23400 PRINT " D TO TOGGLE DUPE
23500 PRINT " M FOR MAIN MENU
23700 GOSUB 36000:GOSUB 36000
23800 PRINT "OTHERWISE enter CALL, RST & TIME"
23900 GOSUB 36000:PRINT "NOTE: When an input is requested, hit <CR> for "
24000 PRINT "default value. In edit mode <CR> skips - no change"
24100 PRINT:PRINT "HIT ANY KEY TO RESUME"
24200 YN$=INPUT$(1)
24300 RETURN
28000 PRINT " (Y/N) ?";
28100 YN$=INPUT$(1)
28200 IF YN$=CHR$(13) THEN YN=0:GOTO 28500
28300 IF YN$="N" OR YN$="n" THEN YN=(-1):GOTO 28500
28400 IF YN$="Y" OR YN$="y" THEN YN=1:GOTO 28500
28450 YN=255
28500 RETURN
30000 PRINT CLS$
30100 GOSUB 36000:PRINT "SEARCH COLUMN 1"
30200 PRINT:INPUT "ENTER STRING TO FIND";SF$
30600 PRINT CLS$:PRINT "SEARCHING"
30700 GOSUB 31710
30800 SFL=LEN(SF$)
30900 FOR I = 1 TO C
31000 IF SF$ = LEFT$(M(I,1),SFL) THEN GOSUB 31800
31100 NEXT I
31200 PRINT:PRINT "DONE ";
31300 GOSUB 28000
31400 IF YN=1 OR YN=0 GOTO 31700
31500 IF YN=(-1) GOTO 30100
31600 GOTO 31200
31700 RETURN
31710 PRINT " # ";TAB(7);"ITEM ONE";TAB(26);"ITEM TWO"
31720 PRINT
31730 RETURN
31800 IF I < 10 THEN PRINT " ";I;
31810 IF I > 9 AND I < 100 THEN PRINT " ";I;
31820 IF I > 99 THEN PRINT I;
31830 PRINT TAB(7);M(I,1);TAB(26);M(I,2)
31840 IF PF=1 GOTO 19500
31850 RETURN
35000 PRINT CLS$
35100 PRINT "REPLACE DISK IN DRIVE"
35200 PRINT "READY ? "
35300 GOSUB 28000
35400 RESET
35500 RETURN
36000 PRINT:PRINT:PRINT:PRINT:RETURN
37000 PRINT:PRINT P$;CG$;P$
37010 GOSUB 28000
37020 IF YN=1 THEN PRINT WT$:PRINT FRE(X$)
37030 RETURN
:PRINT:PRI