Вверх ↑
Разработчик
Ответов: 26072
Рейтинг: 2122
#1: 2011-10-29 18:36:20 ЛС | профиль | цитата
Можно было еще и вот так сделать, но это проверять надо, будет ли прирост



procedure THiSearchInFile._work_doSearch;
var
F: TextFile;
fn, t: string;
BufIn : Array[0..65535] of Char;
str1: string;
begin
num := -1;
str := ';
fn := ReadString(_Data, _data_FileName, _prop_FileName);
if not FileExists(fn) then exit;
t := ReadString(_Data, _data_Text, _prop_Text);
AssignFile(F, fn);
Reset(F);
SetTextBuf(F, BufIn);
FStop := False;
if t = ' then
while not eof(F) and not FStop do
begin
Readln(F, str);
inc(num); // счетчик строк
_hi_onEvent(_event_onSearch, str);
end
else
begin
if not _prop_Sensitive then t := AnsiLowerCase(t);
while not eof(F) and not FStop do
begin
Readln(F, str);
inc(num); // счетчик строк
if _prop_Sensitive then
str1 := str
else
str1 := AnsilowerCase(str);
if Pos(t, str1) then
_hi_onEvent(_event_onNotSearch, str)
else
_hi_onEvent(_event_onSearch, str);
end;
end;
CloseFile(F);
_hi_onEvent(_event_onEnd);
end;
карма: 22

0