配列変数名: array[開始配列番号..終了配列番号] of 型名 = (要素0の値, 要素1の値, 要素2の値, ...);
配列変数名: array[開始配列番号..終了配列番号] of 型名 = (要素0の値, 要素1の値, 要素2の値, ...);
unit Unit_Main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
Button2: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private 宣言 }
public
{ Public 宣言 }
end;
var
Form1: TForm1;
data:array[0..4] of integer = (5,7,1,2,9);
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
for i:=0 to Length(data)-1 do begin
Memo1.Text := Memo1.Text + IntToStr(data[i])+Chr($0D)+Chr($0A);
end;
end;
end.