It took some to work this out.
Wanted it for years.
The data is auto messaging used at my work.
My biggest piece of data has about 100 000 words
and takes 5 seconds to parse it.
Enter to clear.
restore message
read words
dim num(words)
dim word$(words)
for a=1 to words
read num(a)
read word$(a)
next a
word=12
dim z$(word)
open window 640,512
text 20,20,"enter search letters"
label restart
for a=1 to word
z$(a)=""
next a
clear window
text 20,20,"enter search letters"
for a=1 to word
z$(a)=inkey$
'if z$(a)="backspace" then
'z$(a)=z$(a-1)
'a=a-2
'z$(a)=""
'endif
clear window
if z$(a)="enter" goto start
b$=z$(1)+z$(2)+z$(3)+z$(4)+z$(5)+z$(6)
b$=b$+z$(7)+z$(8)+z$(9)+z$(10)+z$(11)+z$(12)
text 20,20,b$
label start
row=0
col=0
for b=1 to words
if instr(word$(b),b$)<>0 then
row=row+1
text 10,row*18+18,str$(num(b))+" "+word$(b)
endif
next b
text 10,(row+1)*18+18,b$
text 10,(row+2)*18+18,str$(col*25+row)
if z$(a)="enter" goto restart
text 600,20,str$(a)
next a
label message
data 98
data 1,"!.................."
data 2,"have a happy day !"
data 5,"cabinets recieved without any grilles"
data 6,"cabinets recieved with grilles"
data 7,"cabinets in poor condition"
data 9,"hold - customer currently on stop credit"
data 10,"all work guaranteed for 90 days"
data 11,"operates but not guaranteed to orig spec"
data 12,"job done at customer request no warranty"
data 13,"under warranty - no charge"
data 14,"special price - new fault to last repair"
data 15,"reconed to original specifications"
data 16,"repaired/reconed with substitute parts"
data 17,"repaired with original manufacturer part"
data 18,"no parts available - agent/manufacturer"
data 19,"no replacement drivers available"
data 20,"charge as quoted"
data 21,"supply reconditioned unit"
data 22,"supply new speaker unit"
data 23,"no job - unit not worth repairing"
data 25,"test on speaker - unit is ok"
data 26,"parts supplied by customer"
data 30,"remove software and clean frame"
data 31,"reassemble old software and test"
data 32,"fit new software and test"
data 33,"strip, clean, fit new software to driver"
data 34,"fit reclaimed surrounds as new not avail"
data 35,"fit new foam surrounds to speaker"
data 36,"replace braids on speaker"
data 37,"adapt surround to fit"
data 40,"replace voice coil in speaker drive unit"
data 41,"repair open circuit in speaker driver"
data 42,"repair voice coil/former in speaker"
data 43,"manufacture custom voice coil & fit"
data 44,"recenter voice coil assembly"
data 45,"remove diaphragm assembly"
data 46,"replace diaphragm assembly"
data 47,"voice coil impedance not as original"
data 48,"physical damamge due to overdriving unit"
data 49,"thermal damage to coil - excessive power"
data 50,"demagnetise, strip and clean magnet assembly"
data 51,"assemble and magnetise magnet assembly"
data 52,"demagnetise and clean magnet assembly"
data 53,"remagnetise loudspeaker"
data 54,"clean magnet assembly and voice coil gap"
data 55,"remove dirt from voice coil gap"
data 56,"remove magnet assembly from frame"
data 57,"refit & recenter magnet assy to frame"
data 59,"check crossover networks & connections"
data 60,"test and remove faulty drivers from cab"
data 61,"refit drivers to cabinet and test"
data 62,"remove drivers from cabs and test"
data 63,"repair cabinet enclosure"
data 64,"replace faulty capacitors"
data 65,"remove xover, repair and refit"
data 66,"replace l-pad attenuators"
data 67,"fit new input terminals"
data 68,"remove old grille cloth from frame"
data 69,"fit new grille cloth to frame"
data 70,"speaker number one"
data 71,"speaker number two"
data 72,"speaker number three"
data 73,"speaker number four"
data 74,"passive radiator"
data 75,"bass unit"
data 76,"midrange unit"
data 77,"tweeter unit"
data 78,"crossover"
data 79,"cabinet"
data 80,"replace cone"
data 81,"repair cone"
data 82,"strengthen apex of cone"
data 83,"repair cone damage caused by cone shear"
data 84,"remove and reglue cone surround to frame"
data 85,"reglue cone / damper to voice coil"
data 86,"plastiflex cone and refit dustcap"
data 87,"treat surround with damping compound"
data 88,"fit new dustcap to speaker"
data 89,"fit new twincone to speaker"
data 90,"fit new damper to speaker"
data 91,"fit new gaskets to speaker"
data 92,"remove mid/tweeter assembly"
data 93,"refit mid/tweeter assembly"
data 94,"remove dustcap from speaker"
data 95,"refit dustcap to speaker"
data 96,"remove gaskets from speaker"
data 97,"refit gaskets to speaker"
data 100,"dismantle, clean pots & switches"
data 101,"check power supply & output"
data 102,"trace & repair dry joints on pcb"
data 103,"replace faulty output stage"
data 104,"reassemble & test"
data 106,"freight pre-paid by customer labels"
data 107,"please fax credit card details, visa"
data 108,"mastercard, bankcard or deposit to"
data 109,"westpac a/c 030104-0277178-00"
data 120,"we do not quote for jobs which can be"
data 121,"repaired within the investigation time"