Registriert seit: 27. Okt 2005
Ort: Düsseldorf
369 Beiträge
Delphi XE5 Professional
|
Re: problem: arrays u subroutine
25. Jan 2007, 12:21
Delphi-Quellcode:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Button2: TButton;
Button3: TButton;
Memo2: TMemo;
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
getallen: array [1..3] of real;
implementation
{$R *.dfm}
procedure TForm1.Button3Click(Sender: TObject);
var i: integer;
begin
getallen[1]:= strtofloat(edit1.text);
getallen[2]:= strtofloat(edit2.text);
getallen[3]:= strtofloat(edit3.text);
//memo2.lines.add (edit1.text + edit2.text + edit3.text)
for i:= low(getallen) to high(getallen) do
memo1.lines.add(' getallen['+IntToStr(i)+' ] '+FloatToStr(getallen[i]));
end;
end.
Du musst das ganze natürlich in eine prozedur reinschreiben...
Richard Mahr
|
|
Zitat
|