1 REM ::::       FILENAME = SEARCH      ::::::::::::::::::::::::::::::::
2 REM ::  THIS PROGRAM WILL FIND ALL THE MATCHES TO YOUR INPUT STRING ::
3 REM ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
10 REM  NUMBER  OF CHARS IN FRONT OF FOUND  VERSE.......
11 F=128
12 REM  NUMBER OF CHARS IN BACK OF FOUND  VERSE......
13 B=128
14 REM F=0 B=0       \ REM CAUSES  A$(N) TO PRINT NOEDITING...MAKESITFASTER
15 DIM R%(66,150)
18 REM NORMAL ..................   S$ = SEARCH STRING
19 S0=1
20 DIM #3,R(66,150)
30 OPEN "BIBLE.I" AS FILE #3
40 FOR I%=1% TO 66%
41 R%(I%,0%)=R(I%,0%)
42 FOR J%=1 TO R%(I%,0)
45 R%(I%,J%)=INT(R(I%,J%)/255)
46 NEXT J%
47 NEXT I%
50 CLOSE #3
70 DIM B$(66)
80 FOR I%=1% TO 66% 
81 READ B$(I%) 
82 NEXT I%
90 DATA GENISIS,EXODUS,LEVITICUS,NUMBERS,DEUTERONOMY,JOSHUA,JUDGES,RUTH
100 DATA 1SAMUEL,2SAMUEL,1KINGS,2KINGS,1CHRONICLES,2CHRONICLES,EZRA
110 DATA NEHEMIAH,ESTHER,JOB,PSALMS,PROVERBS,ECCLESIATES,SONG OF SOLOMON
120 DATA ISAIAH,JEREMIAH,LAMENTATIONS,EZEKIEL,DANIEL,HOSEA,JOEL,AMOS
130 DATA OBADIAH,JONAH,MICAH,NAHUM,HABAKKUK,ZEPHANIAH,HAGGAI,ZECHARIAH,MALACHI
140 DATA MATTHEW,MARK,LUKE,JOHN,ACTS,ROMANS,1CORINTHIANS,2CORINTHIANS
150 DATA GALATIANS,EPHESIANS,PHILIPPIANS,COLOSSIANS,1THESSALONIANS
160 DATA 2THESSALONIANS,1TIMOTHY,2TIMOTHY,TITUS,PHILEMON,HEBREWS,JAMES
161 DATA 1PETER,2PETER,1JOHN,2JOHN,3JOHN,JUDE,REVELATION
165 DIM #4,A1$(4.42880E+06)=1
166 OPEN "BIBLE.BIB" AS FILE #4
170 DIM #1,A$(17366)=255
171 OPEN "BIBLE.BIB" AS FILE #1
172 REM ......          CYCLE     SEARCH  ........  ...........
173 READ F$
174 IF F$="#" THEN  GO TO 950
175 IF F$="END" THEN 10008
176 P=POS(F$,".",1) 
177 IF P=0 THEN F$=F$+".FIN"
178 B$=CLK$
179 READ S$
180 OPEN F$ FOR OUTPUT AS FILE #2 DOUBLE BUF
190 PRINT S$
191 U$="" 
192 U1$=S$ 
193 FOR I=1 TO LEN(S$) 
194 U$=CHR$(95)+U$+CHR$(8) 
195 U1$=U1$+CHR$(8) 
196 NEXT I
204 U$=U1$+U$
207 PRINT #2,"EVERY OCCURRENCE OF ";CHR$(34);S$;CHR$(34);"  IN THE BIBLE "
208 PRINT #2
209 REM --------                START OF LOOP   FOR   SEARCH    --------
210 FOR N=0 TO 17367
212 IF S0=1 THEN 250
214 A$=A$(N)
216 P%=0% 
217 P1%=0% 
218 S5%=0% 
219 S9%=0%
220 FOR S=1 TO S0 
221 P1%=POS(A$,S$(S),1%)
222 IF P1%=0 THEN 230
224 IF P%=0% THEN P%=P1%
225 IF P1%>S9% THEN S9%=P1%
230 NEXT S
235 S5%=S9%-P%
240 IF P%=0 THEN 900
249 GO TO 260
250 P%=POS(A$(N),S$,1%) 
251 IF P%=0 THEN 900 
252 REM  SINGLE STRING SEARCH ........
260 FOR I%=1 TO 66
270 IF R%(I%,1)<N THEN L%=I%
280 NEXT I%
290 FOR I%=1 TO R%(L%,0)
300 IF R%(L%,I%)<N THEN L1%=I%
310 NEXT I%
315 PRINT #2
320 PRINT #2,"* BOOK #";L%;B$(L%);" CHAPTER ";L1% 
321 REM  GOT CV ........
322 IF F+B=0 THEN PRINT #2,A$(N) 
323 GO TO 900
330 N0=N*255+P%-1
333 IF N=0 THEN PRINT A$(N) 
334 GO TO 900
340 N9=N0-F
342 N9=N9-1 
343 REM ...   GO FIND A NICE START .......
344 IF "#"=A1$(N9) THEN 355
345 IF "*"=A1$(N9) THEN 355
346 IF "="=A1$(N9) THEN 355
350 GO TO 342
355 IF N9>=N*255 THEN PRINT #2,SEG$(A$(N),N9-(N*255),P%-1); 
356 GO TO 366
360 FOR N1=N9 TO N0-1 
361 PRINT #2,A1$(N1); 
362 NEXT N1
365 REM  UNDERLINE AND ENHANCE IT .........................
366 PRINT #2,U$;
367 IF P%+B+S5%<255 THEN PRINT #2,SEG$(A$(N),P%,P%+B+S5%); 
368 N1=N0+B+S5% 
369 GO TO 380
370 FOR N1=N0 TO N0+B+S5%
377 PRINT #2,A1$(N1); 
378 NEXT N1
379 REM     FINISH IT CLEAN .............................
380 N1=N1+1 
390 IF "#"=A1$(N1) THEN 900
392 IF "*"=A1$(N1) THEN 900
394 IF "="=A1$(N1) THEN 900
398 PRINT #2,A1$(N1); 
399 GO TO 380
900 NEXT N
901 REM  --------------------              END   OF    SEARCH    -----------
910 CLOSE #2
920 T$=CLK$
930 PRINT B$;"  ";T$
934 S0=1
940 GO TO 172
949 REM ......    READ MULTI SEARCH INPUT......
950 U$=""   
952 B$=CLK$
955 READ S0,F$
956 P=POS(F$,".",1) 
957 IF P=0 THEN F$=F$+".FIM"
958 OPEN F$ FOR OUTPUT AS FILE #2 DOUBLE BUF
959 PRINT #2,"SEARCH  FOR ";
960 FOR S=1 TO S0 
961 READ S$(S) 
962 PRINT S$(S);" "; 
963 PRINT #2,S$(S);"  "; 
964 NEXT S 
965 PRINT #2
974 GO TO 210
1000 REMEMBER THE VARIABLE I.D. SECTION =======================
1010 REM A$()... = 256 BYTE BLOCK FROM BIB.LST
1011 REM A$  =   TEMP A$(N)...
1020 REM B$()... = BOOK NAMES
1030 REM F$ = FILENAME FOR OUTPUT
1040 REM I = INDEX FOR LOOPS
1050 REM L = BOOK NUMBER
1060 REM L1 = CHAPTER NUMBER
1070 REM N = RECORD NUMBER IN BIB.LST
1071 REM N0 = LOCATION OF P% IN A1$ FILE
1072 REM N1 = LOOP INDEX FOR FINDING  DELIMITERS  (#=*)
1079 REM N9 = LOCATION OF "#"
1080 REM P = POSITION OF STRING IN LINE
1081 REM P1% = TEMP P% FOR MULTI STRING SEARCH
1090 REM R(,)... = RECORD NUMBER FOR BOOK AND CHAPTER
1100 REM S$ = STRING TO SEARCH FOR
1101 REM  S$()...  THE MULTI STRING SEARCH VAR
1102 REM  S0 = NUMBER OF STRINGS IN SEARCH
1103 REM   S = LOOP INDEX FOR MULTI STRING SEARCH
1104 REM  S5% = LENGTH FROM FIRST STRING TILL LAST STRING FOUND
1105 REM  S9% = LOCATION OF LAST STRING FOUND  P%=FIRST
1106 REM  U$ = UNDERLING VARIABLE
1108 REM -----       FORMATS :   FILENAME,SEARCH STRING
1109 REM                        #,HOW MANY,FILENAME,S$()...  , , STRINGS
1110 REM .....   DATA  GOES  UNDER HERE  .........................
9999 DATA END,END
10008 CLOSE  
10009 PRINT " ENTER  DATA .... STARTING AT LINE 2000"
10010 PRINT " I.E.      2000 DATA  PERFH, PERFECT HEART   (FILENAME,STRING)"
10011 PRINT "  LAST LINE=9000     #,FILENAME,STRING,...,STRING = MULTI-SEARCH"
10012 END
