procedure
TForm1
.
Button1Click(Sender: TObject);
var
i,n,temp,temp2:
integer
;
begin
temp:=
0
;
for
i:=
0
to
ListBox1
.
Items
.
Count-
1
do
begin
Memo1
.
Lines
.
Strings[
0
]:=
''
;
ParseArt(Memo1
.
Text,
'<articul>'
,
'</articul>'
,Memo2
.
Lines);
temp2:=Memo2
.
Lines
.
Count-
1
;
<font color="Red">
if
ListBox1
.
Items
.
Strings[i] =
'dacha'
then
begin
for
n := temp
to
temp2
do
begin
Memo3
.
Lines
.
Add(
'Дача'
);
end
;
temp:=temp+Memo2
.
Lines
.
Count;
end
;
if
ListBox1
.
Items
.
Strings[i] =
'suvenir'
then
begin
for
n := temp
to
temp2
do
begin
Memo3
.
Lines
.
Add(
'Сувениры'
);
end
;
temp:=temp+Memo2
.
Lines
.
Count;
end
;
if
ListBox1
.
Items
.
Strings[i] =
'posuda'
then
begin
for
n := temp
to
temp2
do
begin
Memo3
.
Lines
.
Add(
'Посуда'
);
end
;
temp:=temp+Memo2
.
Lines
.
Count;
end
;
if
ListBox1
.
Items
.
Strings[i] =
'hoztovar'
then
begin
for
n := temp
to
temp2
do
begin
Memo3
.
Lines
.
Add(
'Хозтовары'
);
end
;
temp:=temp+Memo2
.
Lines
.
Count;
end
;
if
ListBox1
.
Items
.
Strings[i] =
'instrument'
then
begin
for
n := temp
to
temp2
do
begin
Memo3
.
Lines
.
Add(
'Инструменты'
);
end
;
temp:=temp+Memo2
.
Lines
.
Count;
end
;
if
ListBox1
.
Items
.
Strings[i] =
'galante'
then
begin
for
n := temp
to
temp2
do
begin
Memo3
.
Lines
.
Add(
'Галантерея'
);
end
;
temp:=temp+Memo2
.
Lines
.
Count;
end
;
if
ListBox1
.
Items
.
Strings[i] =
'santehnika'
then
begin
for
n := temp
to
temp2
do
begin
Memo3
.
Lines
.
Add(
'Сантехника'
);
end
;
temp:=temp+Memo2
.
Lines
.
Count;
end
;
if
ListBox1
.
Items
.
Strings[i] =
'furnitura'
then
begin
for
n := temp
to
temp2
do
begin
Memo3
.
Lines
.
Add(
'Фурнитура'
);
end
;
temp:=temp+Memo2
.
Lines
.
Count;
end
;
if
ListBox1
.
Items
.
Strings[i] =
'textile'
then
begin
for
n := temp
to
temp2
do
begin
Memo3
.
Lines
.
Add(
'Домашний текстиль'
);
end
;
temp:=temp+Memo2
.
Lines
.
Count;
end
;
if
ListBox1
.
Items
.
Strings[i] =
'technics'
then
begin
for
n := temp
to
temp2
do
begin
Memo3
.
Lines
.
Add(
'Бытовая техника'
);
end
;
temp:=temp+Memo2
.
Lines
.
Count;
end
;</font>
ParseArt(Memo1
.
Text,
'<name>'
,
'</name>'
,Memo4
.
Lines);
ParsePrice(Memo1
.
Text,
'<price>'
,
'</price>'
,Memo5
.
Lines);
ParseCount(Memo1
.
Text,
'<param name="MSK">'
,
'</param>'
,Memo6
.
Lines);
ParseImg(Memo1
.
Text,
'<picture>'
,
'</picture>'
,Memo7
.
Lines);
end
;
Label1
.
Caption:=IntToStr(Memo2
.
Lines
.
Count-
1
);
Label2
.
Caption:=IntToStr(Memo3
.
Lines
.
Count-
1
);
Label3
.
Caption:=IntToStr(Memo4
.
Lines
.
Count-
1
);
Label4
.
Caption:=IntToStr(Memo5
.
Lines
.
Count-
1
);
Label5
.
Caption:=IntToStr(Memo6
.
Lines
.
Count-
1
);
Label6
.
Caption:=IntToStr(Memo7
.
Lines
.
Count-
1
);
end
;