Код: Выделить всё
--->---
Понедельник (2012-07-21 21:51:13)
Заметки
---<---
Вторник (2012-07-22 00:44:49)
Заметки
Заметки
Заметки
--->---
Среда (2012-07-22 11:31:18)
Заметки
---<---
Четверг (2012-07-22 12:55:59)
--->---
Пятница (2012-12-03 16:38:24)
Всё это загружается в StringList.
Дальше вывожу в RichEdit
Код: Выделить всё
procedure TForm1.Button1Click(Sender: TObject);
var
SL: TStringList;
I, Style: Integer;
procA: Boolean;
s: String;
begin
// Очищаем
RichEdit1.Clear;
Style := -1;
procA := False;
I := 0;
// Парсинг
while I < SL.Count do
begin
s := SL[I];
procA := procA or (s = '--->---') or (s = '---<---');
if (s = '--->---') then Style := 3
else if (s = '---<---') then Style := 2
else
begin
if procA then
begin
procA := False;
RichEdit1.Lines.Add('------------------------------');
RichEdit1.Lines.Add(s);
end
else
begin
RichEdit1.Lines.Add(s);
end;
end;
Inc(I);
end;
FreeAndNil(SL);
end;

