16,749
社区成员
发帖
与我相关
我的任务
分享
uses TypInfo;
var
PropInfo: PPropInfo; // 要使用 TypInfo 单元
count,i,k: integer;
con:TComponent;
begin
count := 数组长度;
for i := 0 to count - 1 do
begin
con := FindComponent('edit'+IntToStr(i+1));
if con = nil then
Exit;
PropInfo := GetPropInfo(con.ClassInfo, 'Text');
if Assigned(PropInfo) then
SetStrProp(con, PropInfo, '第'+IntToStr(i+1)+'个');
end;
end;
for i := 0 to Component.Count -1 do
begin
if Component[i] is TEdit then begin
// 再判斷下他的TAG
if TEDit(Components[i]).tag = 99 then TEDit(Components[i]).text := fields[99].asString;
end;
end;
for i := 0 to Component.Count -1 do
begin
if Component[i] is TEdit then begin
// 再判斷下他的TAG
if TEDit(Components[i]).tag = 99 then TEDit(Components[i]).text := fields[99].asString;
end;
end;
for I :=0 to count(数组) - 1 do
begin
case I of
0:begin
edit1.text='';
end;
1:begin
edit2.text='';
end;
......
end;
end;