Appears on
Assembled by Tim Ward from many sources. Contains programs 10001 – 10050.
Related Articles
Think the Sinclair “toy” computer is too small for serious applications? Well, here’s a file manager program that lest you create, delete, list and retrieve records with the best of them.
Source Code
1 REM "FILE MANAGER" 2 REM 3 REM RUSSELL KING 4 REM MICROCOMPUTING MAGAZINE 5 REM MARCH 1983 6 REM 7 REM A LISTS PROGRAM FOR THE TIMEX/SINCLAIR 1000 8 REM 200 REM %M%A%I%N% %M%E%N%U% % % % % % % % % % % % % % 210 CLS 215 SLOW 220 PRINT TAB 7;"FILE MANAGER" 230 PRINT 240 PRINT "1..ADD RECORD" 250 PRINT 260 PRINT "2..CHANGE RECORD" 270 PRINT 280 PRINT "3..DELETE RECORD" 290 PRINT 300 PRINT "4..LIST ALL RECORDS" 310 PRINT 320 PRINT "5..SEARCH FOR A RECORD" 330 PRINT 340 PRINT "6..SORT RECORDS" 350 PRINT 360 PRINT "7..SAVE RECORDS TO TAPE" 370 PRINT 380 PRINT "8..SET UP NEW LIST FILE" 390 PRINT 395 PRINT "9..LIST FIELDS" 400 PRINT 410 PRINT 500 PRINT "WHICH DO YOU WISH TO DO?"; 510 INPUT A 515 LET A=INT A 520 IF A>0 AND A<10 THEN GOTO 560 530 CLS 540 PRINT "PLEASE CHOOSE 1-9" 550 GOTO 230 560 CLS 570 GOSUB A*1000 580 GOTO 210 1000 REM %A%D%D% %R%E%C%O%R%D%S% % % % % % % % % % % % 1010 LET N=N+1 1015 SCROLL 1020 PRINT "RECORD NUMBER ";N 1030 IF N<=M THEN GOTO 1060 1032 LET N=M 1035 SCROLL 1040 PRINT "NO MORE RECORDS CAN BE ADDED" 1050 GOTO 1920 1060 FOR I=1 TO N1 1070 SCROLL 1080 PRINT N$(I); 1090 INPUT I$(N,D(I,1) TO D(I,2)) 1095 PRINT I$(N,D(I,1) TO D(I,2)); 1100 SCROLL 1110 NEXT I 1120 SCROLL 1130 PRINT "CHANGE ANYTHING? "; 1140 INPUT A$ 1145 SCROLL 1150 IF A$(1)="Y" THEN GOTO 1060 1160 SCROLL 1170 PRINT "RECORD ";N;" ADDED" 1180 SCROLL 1900 PRINT "ADD MORE RECORDS?"; 1910 INPUT A$ 1920 SCROLL 1930 IF A$(1)="Y" THEN GOTO 1000 1950 RETURN 2000 REM %C%H%A%N%G%E% %R%E%C%O%R%D% % % % % % % % % % 2010 SCROLL 2011 SCROLL 2020 PRINT "TO CHANGE A RECORD, YOU MUST" 2030 SCROLL 2040 PRINT "ENTER THE RECORD NUMBER FOR" 2050 SCROLL 2060 PRINT "THAT RECORD. DO YOU WISH TO" 2070 SCROLL 2080 PRINT "SEARCH FOR THE RECORD NUMBER?"; 2090 INPUT A$ 2095 SCROLL 2100 IF A$(1)="Y" THEN GOSUB 5000 2110 CLS 2120 SCROLL 2130 PRINT "RECORD NUMBER TO CHANGE: "; 2140 INPUT A 2145 LET A=INT A 2150 SCROLL 2160 IF A>0 AND A<=N THEN GOTO 2200 2170 PRINT "INVALID RECORD NUMBER" 2180 GOTO 2900 2200 FOR I=1 TO N1 2210 SCROLL 2220 PRINT N$(I);I$(A,D(I,1) TO D(I,2)) 2230 SCROLL 2240 PRINT TAB 10;"CHANGE?"; 2250 INPUT A$ 2255 SCROLL 2260 IF A$(1)<>"Y" THEN GOTO 2300 2270 PRINT N$(I); 2280 INPUT I$(A,D(I,1) TO D(I,2)) 2285 PRINT I$(A,D(I,1) TO D(I,2)) 2290 SCROLL 2300 NEXT I 2800 SCROLL 2810 PRINT "FINISHED WITH RECORD ";A 2900 SCROLL 2910 PRINT "CHANGE OTHER RECORDS?"; 2920 INPUT A$ 2930 SCROLL 2940 IF A$(1)="Y" THEN GOTO 2000 2950 RETURN 3000 REM %D%E%L%E%T%E% %A% %R%E%C%O%R%D% % % % % % % % 3010 IF N>0 THEN GOTO 3060 3020 SCROLL 3030 PRINT "NO RECORDS IN FILE" 3040 GOTO 3330 3060 SCROLL 3070 PRINT "ITEMS ARE DELETED BY RECORD" 3080 SCROLL 3090 PRINT "NUMBER. RECORD NUMBERS MAY" 3100 SCROLL 3110 PRINT "CHANGE AFTER AN ITEM IS DELETED" 3120 SCROLL 3130 PRINT "DO YOU WISH TO SEARCH FOR THE" 3132 SCROLL 3135 PRINT "RECORD?"; 3140 INPUT A$ 3150 SCROLL 3160 IF A$(1)="Y" THEN GOSUB 5000 3170 SCROLL 3180 PRINT "RECORD NUMBER TO DELETE:"; 3190 INPUT A 3195 LET A=INT A 3200 IF A>0 AND A<=N THEN GOTO 3250 3210 SCROLL 3220 PRINT "INVALID RECORD NUMBER" 3230 GOTO 3900 3250 FOR I=1 TO N1 3260 SCROLL 3270 PRINT N$(1);I$(A,D(I,1) TO D(I,2)) 3280 NEXT I 3290 SCROLL 3300 PRINT "DELETE THIS RECORD?"; 3310 INPUT A$ 3320 IF A$(1)="Y" THEN GOTO 3360 3330 SCROLL 3340 PRINT "DELETE CANCELLED" 3350 GOTO 3900 3360 IF A=N THEN GOTO 3450 3400 FAST 3405 FOR I=A TO N-1 3410 LET I$(I)=I$(I+1) 3420 NEXT I 3430 SLOW 3450 LET N=N-1 3460 SCROLL 3470 PRINT "RECORD DELETED" 3900 SCROLL 3910 PRINT "DELETE ANY OTHER RECORDS?"; 3920 INPUT A$ 3930 SCROLL 3940 IF A$(1)="Y" THEN GOTO 3010 3950 RETURN 4000 REM %L%I%S%T% %R%E%C%O%R%D%S% % % % % % % % % % % 4010 SCROLL 4015 LET A=0 4020 PRINT "PRINT ALL RECORD FIELDS?"; 4030 INPUT A$ 4040 IF A$(1)="Y" THEN LET A=1 4045 SCROLL 4050 FAST 4060 FOR I=1 TO N1 4070 LET A(I)=A 4075 IF A=1 THEN LET A(I)=I 4080 NEXT I 4090 SLOW 4095 LET J=N1 4100 IF A=1 THEN GOTO 4220 4110 SCROLL 4120 PRINT "ENTER Y FOR EACH FIELD" 4121 SCROLL 4123 PRINT "YOU WANT PRINTED:" 4125 LET J=0 4130 SCROLL 4140 FOR I=1 TO N1 4150 SCROLL 4160 PRINT N$(I);" ?"; 4170 INPUT A$ 4175 PRINT A$(1) 4180 IF A$(1)<>"Y" THEN GOTO 4210 4190 LET J=J+1 4200 LET A(J)=I 4210 NEXT I 4220 SCROLL 4230 PRINT "PRINT TO SCREEN OR PRINTER (S/P)" 4240 INPUT A$ 4250 IF A$(1)="P" THEN GOTO 4600 4300 SCROLL 4305 SCROLL 4310 PRINT TAB 5;L$;" LIST" 4320 SCROLL 4330 FOR I=1 TO N 4340 FOR K=1 TO J 4350 SCROLL 4360 PRINT N$(A(K));I$(I,D(A(K),1) TO D(A(K),2)) 4370 NEXT K 4380 SCROLL 4390 NEXT I 4400 GOTO 4900 4600 FAST 4610 LPRINT TAB 5;L$;" LIST" 4620 LPRINT 4630 FOR I=1 TO N 4640 FOR K=1 TO J 4650 LPRINT 4660 LPRINT N$(A(K));I$(I,D(A(K),1) TO D(A(K),2)) 4670 NEXT K 4680 LPRINT 4690 NEXT I 4700 SLOW 4900 SCROLL 4910 PRINT "ANOTHER LIST?"; 4920 INPUT A$ 4930 IF A$(1)="Y" THEN GOTO 4000 4950 RETURN 5000 REM %S%E%A%R%C%H% %F%O%R% %R%E%C%O%R%D% % % % % % 5010 SCROLL 5020 PRINT "WHICH FIELD TO SEARCH ON:" 5030 FOR I=1 TO N1 5040 SCROLL 5050 PRINT N$(I);" ?"; 5060 INPUT A$ 5070 IF A$(1)="Y" THEN GOTO 5100 5080 NEXT I 5085 SCROLL 5090 PRINT "SELECTION CANCELLED" 5095 GOTO 5900 5100 SCROLL 5110 PRINT "ENTER THE SEARCH STRING"; 5120 INPUT A$ 5122 LET A=LEN A$ 5125 IF A<1 THEN GOTO 5110 5126 IF A<=(D(I,2)-D(I,1)+1) THEN GOTO 5129 5127 LET A=(D(I,2)-D(I,1)+1) 5128 LET A$=A$(1 TO A) 5129 LET A=A-1+D(I,1) 5130 LET F=0 5140 LET Q=0 5150 FAST 5160 FOR J=1 TO N 5170 IF A$=I$(J,D(I,1) TO A) THEN GOSUB 5500 5180 IF Q=1 THEN GOTO 5200 5190 NEXT J 5200 SLOW 5210 SCROLL 5220 PRINT "SEARCH COMPLETE" 5230 SCROLL 5240 IF F=0 THEN PRINT "RECORD NOT FOUND" 5250 GOTO 5900 5500 SCROLL 5504 SCROLL 5505 PRINT "RECORD NUMBER ";J 5510 FOR K=1 TO N1 5520 SCROLL 5530 PRINT N$(K);I$(J,D(K,1) TO D(K,2)) 5540 NEXT K 5550 SCROLL 5560 PRINT "CONTINUE SEARCH?"; 5570 INPUT B$ 5580 IF B$(1)="N" THEN LET Q=1 5590 LET F=1 5600 RETURN 5900 SCROLL 5910 PRINT "ANOTHER SEARCH?"; 5920 INPUT A$ 5930 IF A$(1)="Y" THEN GOTO 5000 5950 RETURN 6000 REM %B%U%B%B%L%E% %S%O%R%T% %R%E%C%O%R%D%S% % % % 6010 SCROLL 6020 PRINT "SORTING TIME DEPENDS ON" 6021 SCROLL 6025 PRINT "NUMBER OF RECORDS" 6030 SCROLL 6040 PRINT "WHICH FIELD TO SORT BY:" 6050 SCROLL 6060 FOR I=1 TO N1 6070 SCROLL 6080 PRINT N$(I);" ?"; 6090 INPUT A$ 6100 IF A$(1)="Y" THEN GOTO 6150 6110 NEXT I 6120 SCROLL 6130 PRINT "SORT CANCELLED" 6140 GOTO 6900 6150 SCROLL 6160 FAST 6170 FOR J=1 TO N-1 6180 FOR K=J TO N 6190 IF I$(J,D(I,1) TO D(I,2))<=I$(K,D(I,1) TO D(I,2)) THEN GOTO 6250 6200 LET B$=I$(J) 6210 LET I$(J)=I$(K) 6220 LET I$(K)=B$ 6250 NEXT K 6260 NEXT J 6270 SLOW 6280 SCROLL 6290 PRINT "SORT COMPLETE" 6900 SCROLL 6910 PRINT "SORT ON ANOTHER FIELD?"; 6920 INPUT A$ 6925 SCROLL 6930 IF A$(1)="Y" THEN GOTO 6000 6950 RETURN 7000 REM %S%A%V%E% %P%R%O%G%R%A%M% %T%O% %T%A%P%E% % % 7010 SCROLL 7020 PRINT "PUT CASSETTE IN TAPE RECORDER" 7030 SCROLL 7040 PRINT "BEGIN RECORDING, THEN" 7042 SCROLL 7045 PRINT "PRESS ANY KEY TO SAVE LIST"; 7050 IF INKEY$="" THEN GOTO 7050 7060 SCROLL 7070 SAVE L$ 7900 GOTO 100 8000 REM %S%E%T% %U%P% %N%E%W% %L%I%S%T% % % % % % % % 8010 SCROLL 8020 PRINT "WHAT LIST NAME TO USE?"; 8030 INPUT L$ 8040 SCROLL 8050 PRINT "HOW MANY RECORD FIELDS?"; 8060 INPUT N1 8061 PRINT N1 8070 SCROLL 8080 LET K=15 8090 PRINT "MAXIMUM NUMBER OF CHARACTERS IN" 8100 SCROLL 8110 PRINT "DESCRIPTION IS (0-15)?"; 8120 INPUT K 8130 IF K>15 THEN LET K=15 8135 IF K<0 THEN LET K=0 8140 SCROLL 8150 LET L=31-K 8160 PRINT "MAXIMUM SIZE OF DATA FIELD" 8170 SCROLL 8180 PRINT "IS ";L;" CHARACTERS" 8182 DIM N$(N1,K) 8184 DIM A(N1) 8186 DIM D(N1,2) 8190 SCROLL 8195 SCROLL 8200 PRINT "NOW ENTER THE FIELD DESCRIPTIONS" 8210 SCROLL 8220 PRINT "AND FIELD LENGTHS:"; 8225 LET J=1 8230 SCROLL 8240 FOR I=1 TO N1 8250 SCROLL 8255 LET A$="" 8260 PRINT "FIELD ";I;":"; 8270 INPUT A$ 8272 PRINT A$ 8275 LET A$=A$+" " 8280 LET N$(I)=A$ 8290 SCROLL 8300 PRINT "FIELD LENGTH (1-";L;"):"; 8310 INPUT A 8312 IF A<1 THEN LET A=1 8315 IF A>L THEN LET A=L 8317 PRINT A 8320 LET D(I,1)=J 8330 LET J=J+A 8335 LET D(I,2)=J-1 8340 SCROLL 8350 NEXT I 8360 LET J=J-1 8370 LET N=0 8380 LET M=INT ((8000-N1*(31-L+12))/J) 8390 SCROLL 8400 PRINT "MAXIMUM NUMBER OF RECORDS" 8410 SCROLL 8420 PRINT "POSSIBLE IS ABOUT ";M 8430 SCROLL 8435 PRINT "HOW MANY DO YOU WANT?"; 8437 INPUT A 8439 LET A=INT A 8440 IF A>0 AND A<M THEN LET M=A 8450 DIM I$(M,J) 8900 SCROLL 8910 PRINT L$;" LIST SET UP" 8920 SCROLL 8930 PRINT "PRESS ANY KEY TO RETURN TO MENU" 8940 IF INKEY$="" THEN GOTO 8940 8950 RETURN 9000 REM %L%I%S%T% %F%I%E%L%D%S% % % % % % % % % % % % 9020 SCROLL 9030 PRINT TAB 5;L$;" LIST FIELDS" 9040 SCROLL 9050 FOR I=1 TO N1 9060 SCROLL 9065 SCROLL 9070 PRINT N$(I) 9080 NEXT I 9090 SCROLL 9100 PRINT "PRESS ANY KEY TO RETURN TO MENU" 9105 SCROLL 9110 IF INKEY$="" THEN GOTO 9110 9900 RETURN 9905 CLEAR 9910 SAVE "1000%8" 9920 RUN