Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 2002.04.29;
Скачать: [xml.tar.bz2];

Вниз

А можно не изобретать велосипед ?   Найти похожие ветки 

 
Decoda   (2002-04-15 21:38) [0]

Уважаемые мастера я делаю HTML гинератор в своей проге так:
procedure TForm1.Button5Click(Sender: TObject);
Var
otchet, temp: textfile;
list: integer;
text: string;
begin
assignfile(otchet, SaveDialog1.FileName);
rewrite(otchet);
append(otchet);
gauge1.MaxValue:=ListBox1.Items.Count;
listbox1.ItemIndex:=-1;


{================================H T M L ====================================}

{===============================Заголовок HTML===============================}


writeln(otchet,"<html>");
writeln(otchet,"<head>");
writeln(otchet,"<title>"+combobox1.text+"</title>");
writeln(otchet,"<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">");
writeln(otchet,"</head>");
writeln(otchet,"<html>");
writeln(otchet,"<style>a:link, a:visited, a:active { text-decoration: none; }a:hover { text-decoration: none; color: #99FF99; }</style>");
writeln(otchet,"<body bgcolor="#4F687D" text="#FFFFFF" link="#33CCCC" vlink="#FFCCFF" alink="#FF0000">");
writeln(otchet,"<table border="1" width="100%" bgcolor="#006633" align="CENTER">");
writeln(otchet,"<tr>");
writeln(otchet,"<td height="16">");
writeln(otchet,"<div align="CENTER">");
writeln(otchet,"<font face="Georgia, Times New Roman, Times, serif" size="5"> ");
writeln(otchet," <font color="#00FF00" size="6">");
writeln(otchet," FAQ на тему:"+" "+combobox1.text+"</font>");
writeln(otchet,"<font color="#FFFF00" size="6"> </font>
</font>");
writeln(otchet,"</div>");
writeln(otchet,"</td>");
writeln(otchet,"</tr>");
writeln(otchet,"</table>");
writeln(otchet,"<table border="1" width="100%">");
writeln(otchet,"<tr>");
writeln(otchet,"<td height="10"> <font face="Georgia, Times New Roman, Times, serif">");


{=======================Cоздаём список вопросов==============================}


For list:=1 to ListBox1.Items.Count do
begin
listbox1.ItemIndex:=listbox1.ItemIndex+1;
writeln(otchet, "<a href="#"+inttostr(list)+"">"+ListBox1.Items[ListBox1.ItemIndex]+"</a><br>");
Gauge1.Progress:=Gauge1.Progress+1;
end;

{======================Cоздали список вопроосов==============================}


writeln(otchet,"</font>
</td>");
writeln(otchet,"</tr></table>");
writeln(otchet,"<table border="1" width="100%">");
writeln(otchet,"<tr>");
writeln(otchet,"<td height="10"> <font face="Georgia, Times New Roman, Times, serif">");
listbox1.ItemIndex:=-1;
Gauge1.Progress:=0;



{=======================Cоздаём список ответов==============================}


for List:=1 to ListBox1.Items.Count do
begin
listbox1.ItemIndex:= listbox1.ItemIndex+1;
assignfile(temp, ExtractFilePath(Application.ExeName)+"Темы\"+combobox1.text+"\"+ListBox1.Items[ListBox1.ItemIndex]+".txt");
reset(temp);
writeln(otchet, "<a name=""+inttostr(listbox1.ItemIndex+1)+""></a>");
writeln(otchet,"<font size="5">
<font color="#99FF99"> "+ListBox1.Items[ListBox1.ItemIndex]+" </font>
</font><br>");
writeln(otchet,"<p> </p>");
while not EoF(temp) do
begin
readln(temp, text);
writeln(otchet, text+"<br>");
end;
writeln(otchet,"<p> </p>");
writeln(otchet,"<hr>");
Gauge1.Progress:=Gauge1.Progress+1;
closefile(temp);
end;

{======================Cоздали список ответов==============================}


writeln(otchet,"</font><center><font size="3"> <font color="#99FF99"> Сгинерировано в программе "Записнушка" (c) 2002-2003 </font></font><br></center></td>");
writeln(otchet,"</tr></table>");
writeln(otchet,"</body>");
writeln(otchet,"</html>");
closefile(otchet);

{===========================E N D H T M L ================================}
end;


А можно не изобретать велосипед ?



Страницы: 1 вся ветка

Форум: "Основная";
Текущий архив: 2002.04.29;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.004 c
6-94532
Timon
2002-02-14 09:21
2002.04.29
TClientSocket


1-94476
Vik_R
2002-04-16 10:03
2002.04.29
hint


1-94381
Каспер
2002-04-17 09:19
2002.04.29
TReeView мигание!


7-94603
Александр!
2002-01-30 14:13
2002.04.29
Абсолютная запись на HDD i FDD???


1-94356
MVova
2002-04-16 17:19
2002.04.29
Количество тактов процессора





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский