谁知道如何将控件的名字转为字符串处理。
原型过程如下。
procedure writeGrid(ff:string;Grid:TadvstringGrid);
var
i,j:integer;
inifile:Tinifile;
s:string;
begin
IniFile := TIniFile.Create(ff);
begin
if Grid.RowCount > 1 then
for i:=1 to Grid.RowCount -1 do
begin
s:='';
if not (Grid.Cells[1,i]='') then
begin
for j:=1 to Grid.ColCount -1 do
if j < Grid.ColCount -1 then
s:=s+Grid.Cells[j,i]+','
else
s:=s+Grid.Cells[j,i];
Inifile.WriteString(grid.,inttostr(i),s);//在这里需要将Grid的名字转为字符串
end;
end;
end;
inifile.free;
end;
这个Grid是通过调用这个过程赋予的,所以可以通过这个过程完成几个Grid的相同处理操作。
我需要在注释的地方完成将控件的名字转为字符串来处理,谁能告诉我。