home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
pctchnqs
/
1992
/
number2
/
strings.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-12-28
|
785b
|
37 lines
PROGRAM strings;
{ Searches any file for printable strings }
{ of 7 or more characters. Useful for extracting }
{ messages and internal documentation from .EXE's. }
USES dos;
VAR infile: FILE OF char; { not text! }
s: string;
c: char;
BEGIN
IF ParamCount <> 1 THEN
BEGIN
WriteLn('You must give a filename.'); Halt
END;
Assign(infile,ParamStr(1));
Reset(infile);
WriteLn('>>Searching ',ParamStr(1),'<<');
WHILE NOT Eof(infile) DO
BEGIN
s := '';
Read(infile,c);
WHILE (c > #31) AND (c < #127) AND NOT Eof(infile) DO
BEGIN
s := s + c;
Read(infile,c)
END;
IF Length(s) > 6 THEN WriteLn(s);
END;
WriteLn('>>End of file<<')
END.