怎样才能把(多个edit组件里的数值)一同赋予(一数组)
我用了下面但有错误:a[i]:=strtoint(edit[i].text);
请问用什么方法解决.

解决方案 »

  1.   

    for i:=0 to 4 do
               a[i]:=TEdit(FindComponent('Edit' + IntToStr(i))).Text
      

  2.   

    var I:integer;
    begin
      for I:=0 to ComponentCount - 1 do
        IF ( Components[I] is TEdit) then (Components[I] as TEdit).Text:=''
    end;
      

  3.   

    1:首先為a[]數組分配足夠的空間;
    2:賦值
    var I,J: integer;
    begin
      J := 1;
      for I:=0 to ComponentCount - 1 do
        IF ( Components[I] is TEdit) then
        begin
          a[J] := (Components[I] as TEdit).Text;
          Inc(J);
        end;
    end;