unit EB_Foto_Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,...;
type
TSatz =
object
PName:
string;
geb:
string;
ID:
string;
procedure bilde_ID;
end;
...
TForm1 =
class(TForm)
E_Name: TEdit;
E_ID: TEdit;
E_geboren: TEdit;
E_Inhalt: TEdit;
E_Datum: TEdit;
...
end;
var
Form1: TForm1;
Satz: TSatz;
implementation
uses ...;
{$R *.dfm}
...
procedure TForm1.FormCreate(Sender: TObject);
var
i: integer;
begin
...
Satz:=TSatz.create
// IDE meckert diese Stelle an !!
...
end;
procedure TForm1.E_gebChange(Sender: TObject);
begin
Satz.geb := Text;
E_ID.Text := Satz.ID;
end;
procedure TForm1.E_NameChange(Sender: TObject);
begin
Satz.PName := Text;
E_ID.Text := Satz.ID;
end;
...
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Methoden von TSatz
procedure TSatz.bilde_ID;
var
s0, s1, s2, s3, s4, s5, s6, s7:
string;
n0, n1, n2, n3, n4, n5, n6, n7: integer;
begin
s0 := geb;
// hier kommt das E_geb hinein
n0 := length(s0);
n1 := pos('
.', s0);
s1 := copy(s0, 1, n1 - 1);
s4 := copy(s0, n1 + 1, n0 - n1);
n2 := pos('
.', s4);
s2 := copy(s4, 1, n2 - 1);
s3 := copy(s4, n2 + 1, 6);
s0 := PName;
// hier kommt das E_Name hinein
n5 := pos('
, ', s0);
s5 := copy(s0, 1, 1);
s6 := copy(s0, n5 + 2, 1);
if length(s1) = 1
then
s1 := '
0' + s1;
if length(s2) = 1
then
s2 := '
0' + S2;
if length(s3) > 2
then
s3 := copy(s3, length(s3) - 1, 2);
s7 := s1 + s2 + s3 + s5 + s6 + '
-0';
ID := s7;
// hier stünde ja das Satz.ID bereit
end;
//..............................................................................
end.