home *** CD-ROM | disk | FTP | other *** search
- { A small program to test the StSearch unit. See StSearch.Pas for }
- { more information on the StrSearch function. }
-
- program StTest;
-
- uses StSearch;
-
-
- var
- Vec : StrSearchTable;
- Index : Word;
- St1,St2 : String;
-
- begin
- repeat
- Write(' Enter string: ');
- ReadLn(St1);
- Write('Enter substring: ');
- ReadLn(St2);
- if (St1 <> '') and (St2 <> '') then begin
-
- Vec := StrSearch(St1,St2);
-
- Write('The positions are: ');
- Index := 1;
- while (Vec^[Index] > Terminator) do begin
- Write(Vec^[Index],' ');
- Inc(Index);
- end;
- WriteLn;
- end
- until (St1 = '') or (St2 = '');
- end.
-