edrp.cn的Blog

学习,需要交流,欢迎大家和我共同来学习C#,ASP.NET,MS SQL Server开发Web项目,欢迎大家和我交流

博客园 首页 新随笔 联系 订阅 管理

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.

posted on 2022-10-20 16:05  edrp.cn  阅读(35)  评论(0编辑  收藏  举报