{ FIND.PAS Jeff Van Tine 3/85 Helena Valley TBBS Helena,Mt. (406)-443-2768 3-1200 baud Will print lines containing the string to be searched for includes conversion from WS format. } PROGRAM Find; VAR Line :STRING[255]; Obj_of_Srch :STRING[80]; I, Where :INTEGER; { <<<<<<<<<<<<<<<<<<<<<< FileIO >>>>>>>>>>>>>>>>>>>>> } Var Input_Filename,Output_Filename :STRING[14]; InFile,OutFile :Text; Procedure FileIO; Begin Write('Enter name of file to search for string in : '); ReadLn(Input_Filename); Write('Enter Output filename or ( CON ) : '); ReadLn(Output_Filename); Assign(InFile,Input_Filename); Assign(OutFile,Output_Filename); Reset(InFile);Rewrite(OutFile); End; { <<<<<<<<<<<<<<<<<<<<<< Find >>>>>>>>>>>>>>>>>>>>> } Procedure Find; Begin Where := Pos(Obj_of_Srch,Line); IF Where >0 then WriteLn(OutFile,Line); End; { <<<<<<<<<<<<<<<<<<<<<< UnWS385 >>>>>>>>>>>>>>>>>>>>> } Procedure UnWS385; Begin ReadLn(InFile,Line); FOR I := 1 TO Length(line) DO IF ORD(Line[I]) > 127 then Line[I] := CHR(ORD(Line[I])-128); End; { < < < < < < < < < < < MAIN > > > > > > > > > > > } BEGIN ClrScr; Write('Enter String to search for : '); ReadLn(Obj_of_Srch); FileIO; WHILE NOT EOF(InFile) DO Begin UnWS385; Find; End; Close(OutFile); END.