var
I: Integer;
A: array[1..N]of string;
begin
for I := 1 to N do
if Assigned(FindComponent('Edit' + IntToStr(I))) then
A[I] := TEdit(FindComponent('Edit' + IntToStr(I))).Text;
end;
I: Integer;
A: array[1..N]of string;
begin
for I := 1 to N do
if Assigned(FindComponent('Edit' + IntToStr(I))) then
A[I] := TEdit(FindComponent('Edit' + IntToStr(I))).Text;
end;
var
ii: Integer;
ss: string;
begin
for ii := 0 to Form1.ComponentCount-1 do
begin
if Form1.Components[ii] is TEdit then
begin
ss := TEdit(Form1.Components[ii]).Text;
youarray = ss;
end;
begin
SetLength(a,high(a) +1);
a[high(a)]:=yourEdit.Text;
end;
var
textstr:array of string;
editarry:array[0..1000] of Tedit;
i,j,counter:integer;
begin
counter:=0;
for i:=0 to self.ControlCount-1 do
if (self.Controls[i] as Twincontrol).ClassName='TEdit' then
begin
inc(counter);
editarry[counter-1]:=self.Controls[i] as Tedit;
end;
setlength(textstr,counter);
for j:=0 to counter-1 do
begin
textstr[j]:=(editarry[j]).text;
showmessage(textstr[j]);
end;
end;
editstr: array[1..4]of string;
i:integer;
str:string;
strName:string;
begin
for i:= 0 to ControlCount -1 do
begin
if Components[i].ClassName ='TEdit' then
begin
strName:=Components[i].Name;
str:=copy(strName,5,length(strName));
editStr[strtoint(str)]:=TEdit(Components[i]).Text;
end;
end;
end;
FindComponent('Edit' + IntToStr(I))
TEdit(FindComponent('Edit' + IntToStr(I)))
请zswang进一步指点,多谢!!!