INSTAMATCHIT by Brian Cavers ---------------------------- The next item is a BASIC string array search routine. It's very fast and easy to use. Originally a machine code routine on the Spectrum, INSTAMATCHIT on SAM is a BASIC procedure but just as fast and easier to use because you just use FIND "SMITH" or FIND INP$ etc. The routine will find any string within a two-dimensional array. As set up, the array name is O$ but you can easily change it by altering lines 48050, 48100 and 48150. In fact, you will see the procedure is fairly short and any of the variables used in it may be changed if they clash. You can DIMension the O$ array to any legal size but it should be two-dimensional, e.g., DIM O$(1000,5). Supposing you have a name and address database in O$(1000,50). You need to find which element (if any) has the name "JONES P." in it. Suppose your program uses INPUT I$ for this name. You then use FIND I$ to find it in O$. If found, the element number in O$ that contains "JONES P." is returned in the variable E. Thus you could then use say... PRINT O$(E) and Jones' full name and address would be printed. If the name is not found then E would become 0 so your routine would need BEFORE the above something like... IF E=0 THEN PRINT "NOT FOUND" followed by a suitable GO TO. Note that you need only input part of a string, e.g., "JON"for "JONES" and it can be anywhere in the element - not just at the start. To install INSTAMATCHIT in your own programs just use... MERGE "MATCH.PROC" and then proceed as described.