home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of the Best
/
_.img
/
02192
/
contest.arc
/
CONTEST.BAS
next >
Wrap
BASIC Source File
|
1987-12-15
|
10KB
|
165 lines
10 ON ERROR GOTO 1200
20 KEY OFF:G$="G3ZCZ CONTEST LOGGING PROGRAM VERSION 3.0" :CLS:WIDTH 80:LOCATE 5,1:PRINT G$:LOCATE 10,1:PRINT "IF TIME IS NOT SET TO UTC, STOP NOW AND SET THE CLOCK IN DOS"
30 K1=0:GOSUB 930
40 BANDS=7:M9=4000:DIM W$(M9),F1(M9),B(BANDS),B1(BANDS):R1$="00":S1$="599":C$="?"
50 BLANK$=" "
60 C4$="RXWBMCFL*/Q?OP+":L0$=BLANK$:QS$="-":QR$=QS$:R$=R1$:S$=S1$:L1$=L0$:L2$=L0$:L3$=L0$:L4$=L0$
70 L5$=L0$:L6$=L0$:L7$=L0$:L8$=L0$:L13$=L0$:L12$=L0$:L11$=L0$:L10$=L0$:L9$=L0$
80 FOR I%=1 TO BANDS:READ B(I%):NEXT:DATA 1,4,16,64,256,1024,4096
90 FOR I%=1 TO BANDS:READ B1(I%):NEXT:DATA 10,15,20,40,80,160,2
100 LOCATE 15,1:INPUT "Enter name of lOG file (D:NAME) Log type .LOG Assumed ",L$:IF L$="" THEN 100
110 GOSUB 880
120 CLS
130 OPEN L$+".$$$" FOR OUTPUT AS #2
140 OPEN L$+".LOG" FOR INPUT AS #1:GOTO 160
150 GOSUB 420 :GOSUB 430 :GOSUB 460:GOTO 1000
160 LOCATE 23,1:PRINT "LOADING LAST ENTRY STRINGS":OPEN L$+".CHK" FOR INPUT AS #3
170 INPUT#3,L13$,L12$,L11$,L10$,L9$,L8$,L7$,L6$,L5$,L4$,L3$,L2$,L1$:CLOSE#3
180 PRINT "OPENING LOGBOOK ";L$:N4=0
190 IF EOF(1) THEN INPUT"Waiting,touch ENTER to continue ";A$:GOSUB 470:GOTO 1000
200 INPUT#1,D$,T$,B$,C$,R$,S$,M$,P$,QS$,QR$,X$ : PRINT N4,C$,X$:IF C$="/*" THEN N4=N4-1 ELSE N4=N4+1
210 IF C$="/*" THEN C$=C8$:GOSUB 300:W$(J)=" ":F1(J)=F1(J)-B(B%):C$="/*":GOTO 240
220 GOSUB 300:W$(J)=C$:F=VAL(B$):FOR Q%=1 TO BANDS:IF INT(F)=B1(Q%) THEN F1(J)=F1(J)+B(Q%):B%=Q%:GOTO 240
230 NEXT
240 C8$=C$:WRITE#2,D$;T$;B$;C$;R$;S$;M$;P$;QS$;QR$;X$:GOTO 190
250 LOCATE 20,1:PRINT BLANK$:LOCATE 20,1:RETURN
260 L0$=BLANK$:MID$(L0$,6)=D$:MID$(L0$,15)=T$:MID$(L0$,20)=C$:MID$(L0$,32)=B$:MID$(L0$,36)=M$:MID$(L0$,40)=P$
270 IF C$="/*" THEN MID$(L0$,1)="-" ELSE N4$=STR$(N4):MID$(L0$,1)=MID$(N4$,2)
280 MID$(L0$,45)=R$:MID$(L0$,49)=S$:MID$(L0$,53)=QS$:MID$(L0$,55)=QR$:MID$(L0$,57)=X$:RETURN
290 T$=LEFT$(TIME$,2)+MID$(TIME$,4,2):D$=RIGHT$(DATE$,2)+"/"+LEFT$(DATE$,2)+"/"+MID$(DATE$,4,2):RETURN
300 J=0:IF C$="/*" THEN 380
310 FOR I%=1 TO LEN(C$):A$=MID$(C$,I%,1):J=J+(ASC(A$)-47):NEXT:J=J*ASC(LEFT$(C$,1)):IF J<0 THEN J=0
320 IF J>M9 THEN J = J-M9 : GOTO 320
330 IF LEN(W$(J))<1 THEN 380
340 IF LEFT$(W$(J),1)=" " THEN 380
350 IF LEFT$(W$(J),LEN(C$))=C$ THEN 370
360 J=J+1:GOTO 320
370 I=0:RETURN
380 I=1:RETURN
390 INPUT "REPORT RECEIVED ";A$:IF A$="" THEN 400 ELSE X$=A$
400 RETURN
410 GOSUB 250:INPUT "REPORT SENT ";S$:IF S$>"599" THEN 410 ELSE RETURN
420 GOSUB 250:INPUT "POWER (watts) ";P$:IF P$<"0" THEN 420 ELSE RETURN
430 GOSUB 250:INPUT "BAND ";F : IF F>160 THEN 430
440 FOR I%=1 TO BANDS:IF INT(F)=B1(I%) THEN 450 ELSE NEXT:LOCATE 22,1:FOR I%=1 TO BANDS:PRINT B1(I%);" ";:NEXT:GOTO 430
450 B$=MID$(STR$(F),2):B%=I%:GOSUB 730:RETURN
460 GOSUB 250:INPUT "MODE ";M$: IF M$="" THEN 460
470 IF M$="SSB" THEN S1$="59" ELSE S1$="599"
480 RETURN
490 GOSUB 250:INPUT "CALL SIGN ";A$
500 IF A$="" THEN 580 :IF LEFT$(A$,1)="" THEN A$=LEFT$(A$,LEN(A$)):GOTO 500
510 LOCATE 22,1:PRINT BLANK$: LOCATE 22,1:C$=A$:GOSUB 300:IF I=0 THEN 530
520 PRINT "OK":GOTO 580
530 F2=F1(J): PRINT "WORKED on ";
540 FOR Q%=BANDS TO 1 STEP -1: IF F2<B(Q%) THEN 570
550 PRINT B1(Q%);" ";:F2=F2-B(Q%):IF B1(Q%)=INT(F) THEN PRINT "DUPLICATE";CHR$(7);
560 IF F2>=B(Q%) THEN 540
570 NEXT
580 IF P2=1 THEN LPRINT C$
590 RETURN
600 GOSUB 250:INPUT "ARE YOU SURE ";A$ :IF A$="" THEN RETURN
610 IF N4<1 THEN GOSUB 250 : PRINT "CAN'T F***** A ZERO ENTRY":RETURN
620 IF A$=""OR LEFT$(A$,1) <> "Y" THEN RETURN
630 C$=C8$:GOSUB 300:F1(J)=F1(J)-B(B%):IF F1(J)<=0 THEN W$(J)=" "
640 C$="/*":GOTO 680
650 IF LEN(X$)=0 THEN 660 ELSE IF LEFT$(C$,1)="?" THEN 660 ELSE 670
660 LOCATE 22,1:PRINT BLANK$: LOCATE 22,1:PRINT "GET THE DATA FIRST":RETURN
670 GOSUB 290:C8$=C$:GOSUB 300: F1(J)=F1(J)+B(B%):W$(J)=C$:GOSUB 1070
680 WRITE#2,D$;T$;B$;C$;R$;S$;M$;P$;QS$;QR$;X$
690 IF C$="/*" THEN 700 ELSE N4=N4+1:GOTO 710
700 N4=N4-1:IF N4<0 THEN N4=0
710 GOSUB 260:L13$=L12$:L12$=L11$:L11$=L10$:L10$=L9$:LOCATE 1,5:PRINT G$
720 L9$=L8$:L8$=L7$:L7$=L6$:L6$=L5$:L5$=L4$:L4$=L3$:L3$=L2$:L2$=L1$:L1$=L0$:IF P1 = 1 THEN LPRINT L0$
730 GOSUB 740:C$="?":R$=R1$:S$=S1$:X$="":RETURN
740 I=3:GOSUB 780:PRINT L13$:I=4:GOSUB 780:PRINT L12$:I=5:GOSUB 780:PRINT L11$:I=6:GOSUB 780:PRINT L10$
750 I=7:GOSUB 780:PRINT L9$:I=8:GOSUB 780:PRINT L8$:I=9:GOSUB 780:PRINT L7$:I=10:GOSUB 780:PRINT L6$
760 I=11:GOSUB 780:PRINT L5$:I=12:GOSUB 780:PRINT L4$:I=13:GOSUB 780:PRINT L3$:I=14:GOSUB 780:PRINT L2$
770 I=15:GOSUB 780:PRINT L1$:RETURN
780 LOCATE I,1:PRINT BLANK$:LOCATE I,1:RETURN
790 GOSUB 250:INPUT "ARE YOU SURE ";A$:IF A$="" THEN RETURN
800 IF LEFT$(A$,1)<>"Y" THEN RETURN
810 CLS:PRINT "SAVING LAST ENTRY STRINGS BEFORE CLOSING":OPEN L$+".CHK" FOR OUTPUT AS #3
820 WRITE#3,L13$;L12$;L11$;L10$;L9$;L8$;L7$;L6$;L5$;L4$;L3$;L2$;L1$
830 CLOSE#3:CLOSE#1:CLOSE#2
840 KILL L$+".BAK"
850 NAME L$+".LOG" AS L$+".BAK"
860 NAME L$+".$$$" AS L$+".LOG"
870 GOTO 1350 : REM END
880 INPUT "Do you want a running log printed out (Y/N) "; A$: IF A$="" THEN 880
890 IF LEFT$(A$,1)="Y" THEN P1 = 1 ELSE IF LEFT$(A$,1)="N" THEN P1 = 0 ELSE 880
900 INPUT "Do you want CALL SIGNS printed out (Y/N) "; A$: IF A$="" THEN 900
910 IF LEFT$(A$,1)="Y" THEN P2 = 1 ELSE IF LEFT$(A$,1)="N" THEN P2 = 0 ELSE 900
920 RETURN
930 IF K1 = 1 THEN 970
940 KEY 1,"QSL "+CHR$(13): KEY 2,"BAND "+CHR$(13):KEY 3,"CALL "+CHR$(13):KEY 4, "*QRT "+CHR$(13):KEY 5,"RPT RX "+CHR$(13)
950 KEY 6,"FUDGE "+CHR$(13): KEY 7,"XMT RPT"+CHR$(13):KEY 8,"/PX CHK"+CHR$(13):KEY 9, "LOG "+CHR$(13):KEY 10,"+MORE "+CHR$(13):K1=1
960 GOTO 990
970 KEY 1,"WATTS "+CHR$(13): KEY 2,"MODE "+CHR$(13):KEY 3,"?CLN "+CHR$(13):KEY 4, "PRINT "+CHR$(13):KEY 5,"OOPS "+CHR$(13)
980 KEY 6," "+CHR$(13): KEY 7," "+CHR$(13):KEY 8," "+CHR$(13):KEY 9, " "+CHR$(13):KEY 10,"+MORE "+CHR$(13):K1=0
990 RETURN
1000 GOSUB 1090: GOSUB 730
1010 GOSUB 1100
1020 LOCATE 17,30:PRINT "CURRENT ENTRY":GOSUB 290:GOSUB 260
1030 MID$(L0$,1)=STR$(N4+1):LOCATE 18,1 : PRINT BLANK$:LOCATE 18,1 : PRINT STR$(N4+1),C$,X$
1040 GOSUB 250:INPUT "QRU ";A$:IF A$=""THEN 1040
1050 FOR J2%=1 TO LEN(C4$):IF LEFT$(A$,1)=MID$(C4$,J2%,1) THEN 1060 ELSE NEXT:GOTO 1040
1060 GOSUB 250:ON J2% GOSUB 390,410,420,430,460,490,600,650,790,1130,1080,1070,1370,880,930:GOTO 1010
1070 LOCATE 21,1:PRINT BLANK$:PRINT BLANK$:PRINT BLANK$:RETURN
1080 LOCATE 22,1:PRINT L0$:RETURN
1090 CLS: KEY ON: RETURN
1100 LOCATE 2,1:PRINT"-------------------------------------------------------------------------------"
1110 LOCATE 1,5:PRINT G$,L$
1120 LOCATE 16,1:PRINT"-------------------------------------------------------------------------------":RETURN
1130 GOSUB 250:INPUT "ARE YOU SURE ";A$:IF A$="" THEN RETURN
1140 INPUT "WHICH PREFIX ";A$:IF LEN(A$)<1 THEN A$="*"
1150 CLS:GOSUB 1100:LOCATE 3,1
1160 I%=0:FOR Q=1 TO M9:IF LEN(W$(Q))<=2 THEN 1190
1170 IF A$="*" THEN 1180 ELSE IF A$=LEFT$(W$(Q),LEN(A$)) THEN 1180 ELSE 1190
1180 PRINT W$(Q),:I%=I%+1:IF I%=4 THEN I%=0:PRINT
1190 NEXT:PRINT:INPUT "READY WHEN YOU ARE, HIT ENTER TO CONTINUE";A$:CLS:GOSUB 1090:GOSUB 740:RETURN
1200 IF ERR = 64 OR ERR = 67 THEN PRINT "BAD FILE NAME ERROR" : GOTO 1640
1210 IF ERL = 140 THEN OPEN L$+".LOG" FOR OUTPUT AS #3:CLOSE#3:OPEN L$+".LOG" FOR INPUT AS #1:RESUME 150
1220 IF ERR = 61 THEN PRINT "Yuk Yuk Yuk DISK FULL ERROR - You may have blown it" :GOTO 1640
1230 IF ERL=160 THEN PRINT "CHECK LIST ERROR, RECOVERING....":RESUME 180
1240 IF ERL = 580 THEN PRINT "PRINTER ERROR, ABORTING PRINTING":RESUME 590
1250 IF ERL = 720 THEN RESUME 730
1260 IF ERL = 840 THEN RESUME 850
1270 IF ERL = 1610 AND ERR = 70 THEN PRINT "DISK WRITE PROTECT ERROR":GOTO 1640
1280 IF ERR = 62 AND ERL = 200 THEN GOSUB 730:INPUT"Waiting,touch ENTER to continue ";A$:RESUME 1000
1290 IF ERR = 53 THEN PRINT "LOG FILE DOES NOT EXIST ON DEFAULT DISK DRIVE":GOTO 1640
1300 IF ERR = 72 THEN PRINT "DISK MEDIA ERROR":GOTO 1640
1310 IF ERR = 71 THEN PRINT "DISK NOT READY ERROR":GOTO 1640
1320 IF ERR = 58 THEN 1640
1330 PRINT "ERROR ";ERR;" AT LINE ";ERL:CLOSE:GOTO 1640
1340 REM RESUME 750:REM CLOSE DOWN IN AN ORDERLY MANNER
1350 INPUT "Is the contest over (Y/N) ";A$: IF LEN(A$)<1 THEN 1350
1360 IF LEFT$(A$,1)="Y" THEN 1390 ELSE 1640
1370 INPUT "What is the number of lost calls (to be added to the memory) ";O:IF O <0 THEN 1370
1380 N4 = N4+O : RETURN
1390 PRINT "CONVERTING (CLEANING UP) CONTEST LOG TO STANDARD LOG"
1400 OPEN L$+".LOG" FOR INPUT AS #1
1410 OPEN L$+".$$$" FOR OUTPUT AS #2
1420 INPUT "Do you want the contacts numbered (Y/N) ";AA$: IF LEN(AA$)=0 THEN 1420
1430 IF LEFT$(AA$,1)="Y" THEN N0=1 ELSE N0=0:IF LEFT$(AA$,1)<>"N" THEN 1420
1440 INPUT "What is the name of the contest ";X$
1450 N=1:T$=" ":B$=" ":C$="-CONTEST":R$=" ":S$=" ":P$=" ":QS$=" ":QR$=" ":GOSUB 1610
1460 IF EOF(1) THEN 1520 ' GET FIRST ENTRY
1470 GOSUB 1570:GOSUB 1580:IF C1$="/*" THEN GOSUB 1630: GOTO 1460 'REM DONT SAVE FUDGE FLAG OR PREVIOUS LINE
1480 IF EOF(1) THEN 1510 ' GET SUBSEQUENT ENTRIES
1490 GOSUB 1570:IF C1$="/*" THEN GOSUB 1630:GOTO 1460 'REM DONT SAVE FUDGE FLAG OR PREVIOUS LINE
1500 GOSUB 1590:GOSUB 1580:GOTO 1480
1510 GOSUB 1590:PRINT :PRINT N9;"Entries were corrected/deleted"
1520 CLOSE#1 : CLOSE#2
1530 NAME L$+".LOG" AS L$+".RUN"
1540 NAME L$+".$$$" AS L$+".LOG"
1550 GOTO 1640
1560 REM SUBROUTINES FOLLOW
1570 INPUT#1,D1$,T1$,B1$,C1$,R1$,S1$,M1$,P1$,QS1$,QR1$,X1$:RETURN
1580 D$=D1$:T$=T1$:B$=B1$:C$=C1$:R$=R1$:S$=S1$:M$=M1$:P$=P1$:QS$=QS1$:QR$=QR1$:X$=X1$:RETURN
1590 R$=MID$(X$,1,3):X$=MID$(X$,4,LEN(X$))
1600 IF N0=1 THEN N$=STR$(N):N$=MID$(N$,2):X$=N$+"-"+X$:N=N+1
1610 WRITE#2, D$;T$;B$;C$;R$;S$;M$;P$;QS$;QR$;X$
1620 PRINT D$;TAB(10);T$;TAB(15);C$;TAB(26);B$;TAB(30);R$;TAB(34);S$;TAB(38);M$;TAB(43);P$;TAB(48);QS$;TAB(50);QR$;TAB(52);X$:RETURN
1630 N9=N9+1:PRINT "ENTRY with ";C$;" DELETED":RETURN
1640 END