unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Menus, ShellApi;
type
TForm1 =
class(TForm)
Panel1: TPanel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Label5: TLabel;
Label6: TLabel;
Button1: TButton;
Button2: TButton;
Label7: TLabel;
Button3: TButton;
Edit7: TEdit;
Label8: TLabel;
Button4: TButton;
procedure Button2Click(Sender: TObject);
procedure Men1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Panel1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
nFile : TextFile;
implementation
var
myArray :
array of string;
k, i, j, z : Integer;
ordner1, ordner2, ordner3 :
String;
{$R *.dfm}
procedure TForm1.Button2Click(Sender: TObject);
begin
Button1.Enabled := True;
Button4.Enabled := False;
Edit1.Text := '
';
Edit2.Text := '
';
Edit3.Text := '
';
Edit4.Text := '
';
Edit5.Text := '
';
Edit6.Text := '
';
Edit7.Text := '
';
end;
procedure TForm1.Men1Click(Sender: TObject);
begin
Close;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
Close;
end;
procedure TForm1.FormCreate(Sender: TObject);
var zeile :
string;
var nFile : Textfile;
dummy :
String;
begin
AssignFile(nFile, '
NEUTEILE.htm');
ReSet(nFile);
while not EoF(nFile)
do
begin
ReadLn(nFile, dummy);
inc(j);
end;
CloseFile(nFile);
ReSet(nFile);
Setlength(myArray, j);
i := 0;
while not EoF(nFile)
do
begin
ReadLn(nFile, zeile);
myArray[i] := zeile;
if myArray[i] = '
</tr>'
then
begin
k := k+1;
end;
if myArray[i] = '
</tr>'
then
begin
k := k+1;
end;
if myArray[i] = '
</table>'
then break;
inc(i);
end;
k := k+1;
CloseFile(nFile);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if Edit1.Text = '
'
then
begin
showmessage('
Bitte alle Angaben vervollständigen!!');
end else
if Edit2.Text = '
'
then
begin
showmessage('
Bitte alle Angaben vervollständigen!!');
end else
if Edit3.Text = '
'
then
begin
showmessage('
Bitte alle Angaben vervollständigen!!');
end else
if Edit4.Text = '
'
then
begin
showmessage('
Bitte alle Angaben vervollständigen!!');
end else
if Edit5.Text = '
'
then
begin
showmessage('
Bitte alle Angaben vervollständigen!!');
end else
if Edit6.Text = '
'
then
begin
showmessage('
Bitte alle Angaben vervollständigen!!');
end else
if Edit7.Text = '
'
then
begin
showmessage('
Bitte alle Angaben vervollständigen!!');
end else
begin
setlength(myArray, i+22);
ordner1 := stringreplace(Edit3.Text, '
-', '
', [rfReplaceAll]);
ordner2 := copy(ordner1,0,4);
ordner3 := copy(ordner1,3,8);
myArray[i] := '
<tr>';
myArray[i+1] := '
<td width=76 valign=top style="width:2.0cm;padding:0cm 5.4pt 0cm 5.4pt">';
myArray[i+2] := '
<p class=MsoNormal align=center style="text-align:center">'+IntToStr(k+1)+'
</p>';
myArray[i+3] := '
</td>';
myArray[i+4] := '
<td width=345 valign=top style="width:258.55pt;padding:0cm 5.4pt 0cm 5.4pt">';
myArray[i+5] := '
<p class=MsoNormal><span style="color:black;layout-grid-mode:line">'+Edit1.Text+'
</span></p>';
myArray[i+6] := '
</td>';
myArray[i+7] := '
<td width=66 valign=top style="width:49.25pt;padding:0cm 5.4pt 0cm 5.4pt">';
myArray[i+8] := '
<p class=MsoNormal align=center style="text-align:center">'+Edit2.Text+'
</p>';
myArray[i+9] := '
</td>';
myArray[i+10] := '
<td width=90 valign=top style="width:67.45pt;padding:0cm 5.4pt 0cm 5.4pt">';
myArray[i+11] := '
<p class=MsoNormal align=center style="text-align:center">'+Edit4.Text+'
.'+Edit5.Text+'
.'+Edit6.Text+'
</p>';
myArray[i+12] := '
</td>';
myArray[i+13] := '
<td width=177 valign=top style="width:132.85pt;padding:0cm 5.4pt 0cm 5.4pt">';
myArray[i+14] := '
<p class=MsoNormal align=center style="text-align:center">[url="'+ordner2+'
/'+ordner3+'
/'+Edit7.Text+'
"]'+Edit3.Text+'
[/url]</p>';
myArray[i+15] := '
</td>';
myArray[i+16] := '
</tr>';
myArray[i+17] := '
</table>';
myArray[i+18] := '
<p class=MsoHeader></p>';
myArray[i+19] := '
</div>';
myArray[i+20] := '
</body>';
myArray[i+21] := '
</html>';
Button1.Enabled := False;
Button4.Enabled := true;
end;
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
AssignFile(nFile, '
NEUTEILE.htm');
Rewrite(nFile);
for z := 0
to length(myArray)-1
do
begin
WriteLn(nFile, MyArray[z]);
end;
CloseFile(nFile);
setlength(myArray, j+1);
Button1.Enabled := True;
Button4.Enabled := False;
Edit1.Text := '
';
Edit2.Text := '
';
Edit3.Text := '
';
Edit4.Text := '
';
Edit5.Text := '
';
Edit6.Text := '
';
Edit7.Text := '
';
end;
procedure TForm1.Panel1Click(Sender: TObject);
begin
ShellExecute(
handle, PChar('
OPEN'), PChar('
NEUTEILE.htm'),
nil,
nil, sw_normal);
end;
end.