Autor Beitrag
N47R0N
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 134



BeitragVerfasst: Sa 14.05.05 19:53 
HI @ ALL

Ich habe mal wieder eine frage an euch unzwar :

Ich habe eine html code der im grunde immer gleich bleibt nur einige stellen müssen geändert werden . Also wollt ich das so machen Pro stelle die sich endert will ich ein edit feld erstellen und am ende ein button , wenn man auf dem Button drückt soll die html datei geschrieben werden , nur mit den änderungen die ich ihn die Edit felder eingegeben habe .

z.B

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
<html>

<head>
<meta http-equiv="Content-Language" content="de">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Eingabefeld0=Titel</title>
</head>

<body>

<div align="center">
  <table border="1" width="81%">
    <tr>                                    
      <td colspan="2">                      
                                                                  
      <p align="center"><b><font size="5">[DER INHALT VON EDIT 1]</font></b></td>
    </tr>
    <tr>


So soll dann die erstellte html aussehen , nur habe ich nicht einmal eine vorstellung wie ich das bewerkstelligen kann .



DANKE schon im voraus
MrFox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 208

WIN 2000 Professional, Ubuntu 5.10
D3 Prof, D7 Pers, D2005 Pers, Java (Eclipse)
BeitragVerfasst: Sa 14.05.05 19:59 
Wohin soll die HTML-Datei geschrieben werden? Sollen die Zeilenumbrüche auch beachtet werden?
MrFox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 208

WIN 2000 Professional, Ubuntu 5.10
D3 Prof, D7 Pers, D2005 Pers, Java (Eclipse)
BeitragVerfasst: Sa 14.05.05 20:12 
Wie wärs mit...

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
procedure Button1Click...
html:TStringList;
begin
html := TStringList.Create;

html.Add('<html>');
html.Add('');
html.Add('<head>');
html.Add('<meta http-equiv="Content-Language" content="de">');
html.Add('<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">');
html.Add('<title>'+EditX.Text+'</title>');
html.Add('</head>');
html.Add('');
html.Add('<body>');

html.Add('<div align="center">');
html.Add('  <table border="1" width="81%">');
html.Add('    <tr>');                                    
html.Add('      <td colspan="2">');                   
html.Add('');                                         
html.Add('      <p align="center"><b><font size="5">'+Edit1.Text+'</font></b></td>');
html.Add('    </tr>');
html.Add('    <tr>');

html.SaveToFile('index.html');
html.Free;
end;
N47R0N Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 134



BeitragVerfasst: Sa 14.05.05 20:13 
Die HTML soll einfach im gleichen ordner wie das Programm gespeichert werden
MrFox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 208

WIN 2000 Professional, Ubuntu 5.10
D3 Prof, D7 Pers, D2005 Pers, Java (Eclipse)
BeitragVerfasst: Sa 14.05.05 20:23 
OK, dann empfehle ich den obenstehenden Code.
N47R0N Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 134



BeitragVerfasst: Sa 14.05.05 20:30 
Danke erstmal für deine antwort

Ich wüsste da gerne nochwas :

Ihr kennt doch diese teile in einem Programm diese kleinen felder in denen man einen hacken drann setzt und die sollen dann verwendet werden ich will das so machen wenn ein hacken in diesem feld ist soll der inhalt von einem Edit Feld mit benutzt werden wenn nciht dann wird das Edit feld einfach ausgelassen .
MrFox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 208

WIN 2000 Professional, Ubuntu 5.10
D3 Prof, D7 Pers, D2005 Pers, Java (Eclipse)
BeitragVerfasst: Sa 14.05.05 20:33 
Hast du dich schon einmal mit den Grundlagen beschäftigt?

TCheckBox1.Checked ist die zuständige Boolean-Eigenschaft !