'Copyright 1999 The American Cryptogram Association (ACA) '3613 Piedmont Drive, Plano TX 75075-6234 'All rights reserved. Function Matches(Word$,Init%) Static Dim Pat[32] 'Call first If Init% <> 0 Then 'with Init=1 WLen = Len(Word$) 'to create PatLen=WLen-1 'the pattern For I=1 to PatLen 'in array C$=Mid$(Word$,I,1) 'Pat[] Pat[I]=Instr(I+1,Word$,C$) Next I Else Match=1 'Assume Match found WSeg$=Word$ 'Scan terminal SegLen=Len(WSeg$) 'segments for While SegLen >= Wlen 'pattern match For I=1 to PatLen 'Check cur C$=Mid$(WSeg$,I,1) 'segment Posn=Instr(I+1,WSeg$,C$) 'with If Pat[I]<>Posn Then'pattern in Goto NextSeg 'Pat[]. End If ' Next I ' Goto MatchSuccess 'Matched. NextSeg: 'No match, WSeg$=Mid$(WSeg$,2) 'examine SegLen=SegLen-1 'next Wend 'segment End If Match=0 MatchSuccess: Matches=Match End Function 'Matches