~~~~~~~~~~~~~~~~~~~~~~~~~
function GetIsWord: boolean;
var s: string; {presume no word>255 chars}
c: char;
begin
result:= false;
s:= ' ';
while not eof(f) do
begin
read(f, c) ;
if not (c in ['a'..'z','A'..'Z'{,... etc}]) then break;
s:=s+c;
end;
result:= (s <>' ') ;
end;
procedure GetWordCount(TextFile: string) ;
begin
Count:= 0;
assignfile(f, TextFile) ;
reset(f) ;
while not eof(f) do
if GetIsWord then inc(Count) ;
closefile(f) ;
end;
~~~~~~~~~~~~~~~~~~~~~~~~~
Delphi tips navigator:
» How to detect when a TMediaPlayer stops playing
« Retrieving a list of installed Applications on Windows

