0 ' CRDFIL.BAS Card File Program for the Model 100/102 and Tandy 200 1 ' For operating instructions, see the file CRDFIL.DOC 2 ' Copyright 1987 Tony B. Anderson All Rights Reserved 3 ' 10 ' V2 - 12/27 fix line 608-609 11 ' V3 - 1/1/88 fix line 408 12 ' 100 MAXFILES=1:CLEAR1000:M=0 105 CLS:PRINT@50,"CARD FILE PROGRAM":PRINT 110 PRINT" Do you want to reate a new file, isplay or dd to an existing File, nd or enu? (C/D/A/E/M) "; 115 Q$=INPUT$(1):PRINTQ$:IFINSTR("Aa",Q$)THEN600 120 IFINSTR("Cc",Q$)THEN200 125 IFINSTR("Dd",Q$)THEN400 130 IFINSTR("Ee",Q$)THENMENU 135 IFINSTR("Mm",Q$)THENMENU 140 BEEP:GOTO100 200 CLS 202 INPUT" Filename to Create";F$ 210 INPUT" Number of entries on card";N 212 GOSUB1000 220 FORA=1TON:CLS:PRINT 222 GOSUB1100 224 NEXT 240 CLS:PRINT@41,"Let's review what your prompt screen will look like. Press ENTER when you are ready to continue. "; 242 Q$=INPUT$(1):CLS 244 FORA=1TON 246 PRINT@P(A),A$(A) 248 NEXT:PRINT@39,"";:Q$=INPUT$(1) 250 CLS:PRINT@41,"Do you want to make any changes? (Y/N) ";:Q$=INPUT$(1):PRINTQ$:IFQ$=""THEN290 252 IFINSTR("Nn",Q$)THEN270 254 FORA=1TON:CLS 256 PRINT"Prompt #"A":":PRINT:PRINTA$(A) 258 PRINT"Line #"INT(P(A)/40)+1" Column #"P(A)MOD40+1:PRINT 260 PRINT" Is this one correct? (Y/N)";:Q$=INPUT$(1):PRINTQ$ 262 IFINSTR("Yy",Q$)THEN266 264 GOSUB 1100 266 NEXT:GOTO240 270 CLS:PRINT:PRINT" File now being created..." 272 OPENF$FOROUTPUTAS1 274 PRINT#1,N 276 FORA=1TON:PRINT#1,A$(A):PRINT#1,P(A):NEXT 280 GOSUB1400:GOSUB1450 290 CLS:FORA=1TON 292 PRINT@P(A),A$(A); 294 LINEINPUTB$(A):IFB$(A)=""THENB$(A)=" " 296 IFINSTR("ENDEndend",B$(A))THENRUN 298 NEXT 300 CLS:PRINT@41,"Was all the data correct? (Y/N) ";:Q$=INPUT$(1):PRINTQ$ 302 IFINSTR("Nn",Q$)THENGOSUB1450:GOTO290 304 IFINSTR("Yy",Q$)THENFORA=1TON:PRINT#1,B$(A):NEXT:GOTO290ELSEBEEP:GOTO300 400 PRINT:PRINT" Would you like to isplay all cards or earch for a word match? (D/S) ";:Q$=INPUT$(1):PRINTQ$ 404 IFINSTR("Dd",Q$)THEN410 406 IFINSTR("Ss",Q$)THEN500 408 BEEP:CLS:PRINT:GOTO400 410 GOSUB1200:GOSUB1300 412 IFEOF(1)THEN440 414 GOSUB1350:GOSUB1360:GOSUB1250:GOTO412 440 CLS:PRINT@41,"Last card in file has been displayed.":GOTO522 500 GOSUB1200:GOSUB1300 502 CLS:PRINT@41,"What word would you like to search for? ";:LINEINPUTS$ 504 PRINT:PRINT" OK, now looking through the file...":M=INT(M) 506 IFEOF(1)THEN520 508 GOSUB1350:FORA=1TON:IFINSTR(B$(A),S$)THENGOSUB1360ELSENEXT:GOTO506 510 M=1:GOSUB1250:GOTO504 520 CLS:IFM=0THENPRINT@41,"No Matching Entires."ELSEPRINT@41,"End of file." 522 PRINT:PRINT" Press ENTER to return to option menu. ";:Q$=INPUT$(1):RUN 600 GOSUB1200:GOSUB1300 602 CLOSE:GOSUB1400 604 CLS:FORA=1TON 606 PRINT@P(A),A$(A); 608 LINEINPUTB$(A):IFB$(A)=""THENB$(A)=" " 609 IFINSTR("ENDEndend",B$(A))THENRUNELSENEXT 610 CLS:PRINT@41,"Was the data correct? (Y/N) ";:Q$=INPUT$(1):PRINTQ$ 612 IFINSTR("Nn",Q$)THENGOSUB1450:GOTO604 614 IFINSTR("Yy",Q$)THEN620ELSEBEEP:GOTO610 620 PRINT:PRINT" Now writing data to the file..." 622 OPENF$FORAPPENDAS1 624 FORA=1TON:PRINT#1,B$(A):NEXT 626 CLOSE:GOTO604 1000 DIMA$(N),B$(N),P(N):RETURN 1100 PRINT" Prompt for #"STR$(A)": ";:LINEINPUTI$ 1102 A$(A)=I$+" ":I$="" 1104 INPUT" Screen position: Line # ";X 1106 INPUT" Column # ";Y 1108 P(A)=(X*40+Y)-41:X=0:Y=0 1110 RETURN 1200 CLS:PRINT@42,"Name of file to be used";:INPUTF$:PRINT 1202 ONERRORGOTO1210:OPENF$FORINPUTAS1:CLOSE 1204 ONERRORGOTO0:RETURN 1210 BEEP:PRINT" File does not exist. Press ENTER to continue. ";:Q$=INPUT$(1):RUN 1250 PRINT@39,"";:Q$=INPUT$(1):CLS:RETURN 1300 CLOSE:OPENF$FORINPUTAS1 1302 IFEOF(1)THENBEEP:PRINT" Data file is empty":PRINT:CLOSE:STOP 1304 INPUT#1,N:GOSUB1000 1306 FORA=1TON:IFEOF(1)THEN1320 1308 LINEINPUT#1,A$(A):INPUT#1,P(A):NEXT 1310 RETURN 1320 BEEP:PRINT" Data file error":PRINT:CLOSE:STOP 1350 FORA=1TON:IFEOF(1)THEN1320 1352 LINEINPUT#1,B$(A):NEXT:RETURN 1360 CLS:FORA=1TON:PRINT@P(A),A$(A);B$(A);:NEXT:RETURN 1400 CLS:PRINT@41,"Now ready for input phase. Press the ENTER key to start. Type `END' at any" 1402 PRINT" prompt to terminate the input mode and return to the opening menu. ";:LINEINPUTQ$ 1404 IFQ$=""THEN1406ELSEIFINSTR("ENDEndend",Q$)THENMENU 1406 RETURN 1450 FORA=1TON:B$(A)=" ":NEXT:RETURN