unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
ptrEmployment = ^TEmployment;
TEmployment =
record
FWorkInstruction :
String;
//ausgeführte Tätigkeit
FDuration : Double;
//Dauer
FDepartment :
String;
//Abteilung pro Tätigkeit
end;
TTest =
class
private
FEmployment:
Array[0..4]
of TEmployment;
function GetWorkInstruction(nIndex: Integer):
String;
public
property Taetigkeit[nIndex: Integer]:
String read GetWorkInstruction;
constructor Create;
end;
TForm1 =
class(TForm)
Button1: TButton;
Button2: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
Montag: TTest;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{ TTest }
constructor TTest.Create;
var
i: Integer;
begin
for i := 0
to 4
do
begin
FEmployment[ i ].FWorkInstruction := '
';
FEmployment[ i ].FDuration := 0;
FEmployment[ i ].FDepartment := '
';
end;
FEmployment[ 0 ].FWorkInstruction := '
Test';
end;
function TTest.GetWorkInstruction(nIndex: Integer):
String;
begin
Result := FEmployment[ nIndex ].FWorkInstruction;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Montag.Create;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Label1.Caption := Montag.Taetigkeit[ 0 ];
end;
end.