unit ListTest;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TForm26 = class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
TIndexRecoder=record
BandIndex:Integer;
ColIndex:Integer;
Caption:String;
end;
TBandList= array of TIndexRecoder;
var
Form26: TForm26;
implementation
{$R *.dfm}
procedure TForm26.Button1Click(Sender: TObject);
var
vCol:Integer;//列数量
I:Integer;
vIndexRecoder:TIndexRecoder;
vBandList:TBandList;
begin
vCol:=12;
SetLength(vBandList,vCol);
for I := 0 to vCol-1 do
begin
vIndexRecoder.BandIndex:=i;
vIndexReCoder.ColIndex:=i+100;
vIndexRecoder.Caption:='第'+IntToStr(i)+'个元素';
vBandList[i]:=vIndexRecoder;
end;
for vIndexRecoder in vBandList do
begin
with vIndexRecoder do
begin
Memo1.Lines.Add(Caption+'==BandIndex:'+IntToStr(BandIndex)+'===ColIndex:'+IntToStr(ColIndex)) ;
end;
end
end;
end.