15.07.2010, 10:20
|
|
Прохожий
|
|
Регистрация: 14.07.2010
Сообщения: 12
Репутация: 10
|
|
не работает, не могу понять почему, что не так, подскажите...
Код:
function NodeColor(Text:string; const SearchText:string; var OutText:string):Boolean;
var
ColorPos:Integer;
begin
Result := False;
if Length(Text) = 0 then
Exit;
ColorPos := Pos(LowerCase(SearchText), LowerCase(Text));
if ColorPos <> 0 then
begin
Delete(Text,1,ColorPos + Length(SearchText) - 1);
OutText := Copy(Text, 1, Pos('.',Text) - 1);
OutText := Trim(OutText);
Result := True;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
pColor:string;
F: TextFile;
S: string;
const
cstop:string='волос:'; //текст, после которой идет капча
begin
AssignFile(F, 'text.txt');
Reset(F);
while not Eof(F) do
begin
Readln(F, S);
if NodeColor(s, cstop, pColor) then ShowMessage(pColor);
end;
CloseFile(F);
end;
Admin: Не забываем про теги!
|