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
/
MBUG
/
MBUG109.ARC
/
BEEDAT.MWB
< prev
next >
Wrap
Text File
|
1979-12-31
|
6KB
|
159 lines
00100 REM *** BEEDAT version 2.0 ***
00110 STRS (4000)
00120 DIM D0(100,5),D1(5)
00130 N1$="NEW":C=960:GOTO 2040
00140 REM *** SORT ********************************************
00150 IF R<2 THEN RETURN ELSE PRINT"FIELD #";:GOSUB 2030
00160 GOSUB 2010:L=INT(VAL(Z7$))
00170 IF L<1 OR L>5:GOSUB 2140:RETURN
00180 PRINT"SORTING";:P=0:M=R
00190 M=M/2:IF M=0 THEN 290
00200 FOR K=1 TO M
00210 I=K:J=K+M:S=0
00220 IF D0$(I,L)<=D0$(J,L) THEN 260 ELSE LET S=1
00230 FOR N=1 TO 5
00240 D1$(N)=D0$(I,N):D0$(I,N)=D0$(J,N):D0$(J,N)=D1$(N)
00250 NEXT N
00260 I=J:J=J+M: IF J<=R THEN 220
00270 IF S<>0 THEN 210
00280 NEXT K:GOTO 190
00290 PLAY 10,2:RETURN
00300 REM *** LOAD FILE ***************************************
00310 R=0:CLS:GOSUB 2010:PRINT"LOADING...";
00320 IN#3:OUT#0 OFF
00330 INPUT Z7$:IF Z7$(;1,5)<>"*****"THEN 330
00340 N1$=Z7$(;11,16):R=INT(VAL(Z7$(;6,10))):POKE 61440+R,13
00350 FOR I=1 TO R:INPUT Z7$,D0$(I,1),D0$(I,2),D0$(I,3),D0$(I,4),D0$(I,5):IF INT(VAL(Z7$))<>I THEN NEXT*I 380
00360 POKE 61439+I,9:NEXT I
00370 IN#0:OUT#0:CLS:PRINT N1$:PLAY 9:RETURN
00380 R=I:IN#0:OUT#0:CLS:PRINT "BAD LOAD":PLAY 9,3;0,8:RETURN
00390 REM *** SAVE FILE ***************************************
00400 CLS:CURS C:INPUT"ENTER FILE NAME (6 characters max.)";N1$;
00410 N1$=N1$+"//////":N1$=N1$(;1,6)
00420 GOSUB 2010:PRINT"START TAPE AND PRESS <RET>";
00430 GOSUB 2030:PRINT"RECORDING ...";N1$;
00440 POKE 61440+R,13
00450 OUT#3:PRINT"*****";[I5 R];N1$
00460 FOR I=1 TO R:PRINT[I5 I];",";
00470 PRINT D0$(I,1);",";D0$(I,2);",";D0$(I,3);",";D0$(I,4);",";D0$(I,5)
00480 POKE 61439+I,9
00490 PLAY 0,4
00500 NEXT I
00510 PRINT"0,0,0,0,0,0,0,0,0"
00520 OUT#0:PLAY 9:RETURN
00530 REM *** INSERT *******************************************
00540 Q=0:FOR I=1 TO 5
00550 PRINT"FIELD #";I;" ";
00560 IF Q<134 THEN PRINT [A40 95]; ELSE PRINT[A14 95];
00570 CURS 969:INPUT""D1$(I);:GOSUB 2010:V=LEN(D1$(I))
00580 Q=Q+V:IF Q>170 OR V>40:Q=Q-V:GOSUB 2000:GOTO 550
00590 NEXT I
00600 GOSUB 2010:PRINT"SORTING";:R=R+1
00610 IF R>1 THEN 650
00620 FOR I=1 TO 5
00630 D0$(1,I)=D1$(I)
00640 NEXT I:RETURN
00650 FOR I=R-1 TO 1 STEP -1
00660 IF D0$(I,1)>D1$(1) THEN 720
00670 IF D0$(I,1)<D1$(1) THEN 690
00680 IF D0$(I,2)+D0$(I,3)+D0$(I,4)+D0$(I,5)>D1$(2)+D1$(3)+D1$(4)+D1$(5) THEN 720
00690 FOR J=1 TO 5
00700 D0$(I+1,J)=D1$(J)
00710 NEXT J:NEXT*I 770
00720 FOR J=1 TO 5
00730 D0$(I+1,J)=D0$(I,J)
00740 IF I=1:D0$(I,J)=D1$(J)
00750 NEXT J
00760 NEXT I
00770 RETURN
00780 REM *** DELETE ******************************************
00790 INPUT"DELETE #"D;:IF D<1 OR D>R THEN GOSUB 2140:RETURN
00800 R=R-1:IF R<D THEN RETURN
00810 GOSUB 2010:PRINT"SORTING";
00820 FOR I=D TO R
00830 FOR J=1 TO 5
00840 D0$(I,J)=D0$(I+1,J)
00850 NEXT J
00860 NEXT I
00870 FOR I=1 TO 4:D0$(R+1,I)="":NEXT I:RETURN
00880 REM *** EDIT ********************************************
00890 INPUT"EDIT #"D;:IF D<1 OR D>R THEN GOSUB 2140:RETURN
00900 CLS:PRINT"#";D
00910 FOR I=1 TO 5
00920 PRINT TAB(5);I;" ";D0$(D,I)
00930 NEXT I:GOSUB 2010:PRINT"FIELD #";:GOSUB 2030
00940 F=INT(VAL(Z7$)):IF F<1 OR F>5 THEN GOSUB 2140:RETURN
00950 CURS 1,F+1:PRINT">>>":GOSUB 2010:PRINT"FIELD #";F;
00960 INPUT ""D0$(D,F);:V=LEN(D0$(D,F))
00970 IF V>40:GOSUB 2000:RETURN
00980 CURS 8,F+1:PRINT[A45 32];:CURS 8,F+1:PRINT D0$(D,F);
00990 FOR I=1 TO 5
01000 D1$(I)=D0$(D,I)
01010 NEXT I:GOSUB 800:GOSUB 600
01020 RETURN
01030 REM *** FIND ********************************************
01040 PRINT"FIELD #";:GOSUB 2030:F=INT(VAL(Z7$)):GOSUB 2010
01050 IF F<1 OR F>5 THEN GOSUB 2140:RETURN
01060 INPUT"SEARCH FOR >> ";D1$(F);
01070 FOR I=1 TO R
01080 IF D0$(I,F)<>D1$(F) THEN 1140 ELSE CLS:PRINT"#";I
01090 FOR J=1 TO 5
01100 PRINT J;") ";D0$(I,J)
01110 NEXT J:GOSUB 2010
01120 PRINT "IS THIS THE ONE ? (Y/N) ";:GOSUB 2030
01130 IF Z7$="Y" THEN NEXT*I 1150
01140 NEXT I:CLS:PRINT\"SEARCH FINISHED":GOSUB 2010
01150 RETURN
01160 REM *** LIST ********************************************
01170 CLS:PRINT:Z=0
01180 FOR I=1 TO R
01190 PRINT"#";I;
01200 FOR J=1 TO 5
01210 PRINT TAB(6);D0$(I,J)
01220 NEXT J:Z=Z+1
01230 IF Z=3:GOSUB 2020 :Z=0:CLS:PRINT
01240 NEXT I:GOSUB 2010:RETURN
01250 REM *** PRINT ******************************************
01260 PRINT"PRINTER ON ...";
01265 OUTL#1
01270 LPRINT N1$:LPRINT
01280 FOR I=1 TO R
01290 LPRINT"#";I;
01300 FOR J=1 TO 5
01310 LPRINT TAB(6);D0$(I,J)
01320 NEXT J:LPRINT
01330 NEXT I:RETURN
01990 REM *** Minor subroutine ***
02000 PRINT"TOO LONG";:PLAY 23,2;0,12
02010 CURS C:PRINT[A63 32];:CURS C:RETURN
02020 PRINT"PRESS ANY KEY TO CONTINUE";
02030 POKE 257,1:Z7$=KEY:IF Z7$=""THEN 2030 ELSE RETURN
02040 REM *** HELP ********************************************
02050 RESTORE 2230:GOSUB 2180
02060 REM *** CONTROL *****************************************
02070 CURS 936:PRINT[I6 R];[F8.0 FRE(0)];[F8.0 FRE($)]
02080 GOSUB 2010:PRINT"COMAND ";:GOSUB 2030:GOSUB 2010
02090 Z=ASC(Z7$):IF Z<67 OR Z>83 THEN LET Z=1 ELSE LET Z=Z-65
02100 IF R=0 AND (Z<>6 AND Z<>8) THEN GOSUB 2140:GOTO 2060
02110 ON Z GOSUB 2140,2130,780,880,1030,300,2040,530,2140,2140,1160,2140,2140,2140,1250,2140,390,140
02120 GOTO 2070
02130 CLS:RETURN
02140 IF R>0 THEN PRINT"?????";ELSE PRINT"NO RECORDS";
02150 PLAY 23,2;0,16:RETURN
02160 REM *** Centralise ***
02170 PRINT TAB(64-LEN(Z7$))/2;Z7$:RETURN
02180 REM *** Menu ***
02190 CLS:PRINT:READ Z7$:GOSUB 2160
02200 READ Z,T:FOR I=1 TO Z:READ Z7$
02210 PRINT TAB(T);Z7$
02220 NEXT I:RETURN
02230 DATA "B E E D A T",12,43,"C - CLS","D - DELETE","E - EDIT"
02240 DATA "F - FIND","G - GET FILE","H - HELP","I - INSERT"
02250 DATA "L - LIST","P - PRINT","R - RECORD FILE","S - SORT"
02260 DATA "RECDs MEMFR STRFRE"
IN#0:CLOSE 6
"I - INSERT"
02250 DATA "L - LIST","P - PRINT","R - RECORD FILE","S - SORT"
02260 DATA "RECDs MEMFR STRFRE"
IN#0: