Ich möchte einem Array Werte zu weisen und diese dann ausgeben.
Delphi-Quellcode:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 =
class(TForm)
Edit1: TEdit;
Button1: TButton;
Edit2: TEdit;
Label1: TLabel;
Button2: TButton;
Label2: TLabel;
procedure Edit1Change(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Edit2Change(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
werte :
array[1..10]
of integer;
implementation
{$R *.dfm}
procedure TForm1.Button2Click(Sender: TObject);
var n: integer;
begin
werte[1] := 3;
werte[2] := 8;
werte[4] := 12;
for n:= 1
to 2
do
begin
Label2.Caption := Label2.Caption + FloatToStr(n) + werte[1];
end;
end;
end.
Mein Problem, es geht noch nicht.