unit frmMain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm3 =
class(TForm)
btnAdd: TButton;
btnShowAll: TButton;
procedure btnAddClick(Sender: TObject);
procedure btnShowAllClick(Sender: TObject);
private
{ Private declarations }
FAppointmentArray:
Array of String;
procedure AddAppointment(
const AValue:
String);
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
{$R *.dfm}
procedure TForm3.AddAppointment(
const AValue:
String);
begin
// die Länge neu festsetzen
SetLength(FAppointmentArray, Length(FAppointmentArray)+1);
// Wert zuweisen
FAppointmentArray[High(FAppointmentArray)] := AValue;
end;
procedure TForm3.btnAddClick(Sender: TObject);
begin
AddAppointment('
Wert Nummer ' + IntToStr(Length(FAppointmentArray)));
end;
procedure TForm3.btnShowAllClick(Sender: TObject);
var
i: Integer;
ASL: TStringlist;
begin
ASL := TStringlist.Create();
try
for i := 0
to high(FAppointmentArray)
do
begin
ASL.Add(FAppointmentArray[i]);
end;
ShowMessage(ASL.Text);
finally
ASL.Free();
end;
end;
end.