14.07.2010, 20:58
|
|
Новичок
|
|
Регистрация: 16.01.2010
Сообщения: 86
Репутация: 35
|
|
можно просто парсить текст:
Код:
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.Button1Click(Sender: TObject);
var
pColor:string;
const
ColorText = 'цвет волос:';
begin
if NodeColor('цвет волос: каштан. возраст: 30 лет.', ColorText, pColor) then
ShowMessage(pColor);
end;
__________________
Arrrgh
|