var
na:array of string;
setlength(na,10);
for i:=0 to 9 do
begin
na[i]:='fff';
listbox1.items.add(na[i]);
end;

解决方案 »

  1.   

    J的最大值Max知道就可以了.
    SetLength(na,Max);
    for j := 0 to Max do
      na[j] := ?????
      

  2.   

    那你最好用TStringList,而不要用array of string;
      

  3.   

    SetLength(na,10) 只是改变安符串的长度,没有改变数组长度,
      

  4.   

    刚才错了,可以。
    var
     na : array of string;
     j : Integer;
     i : Integer;
    begin
     for j := 0 to 10 do begin
       SetLength(na,j+1);
       na[j] := 'adsff';
     end;
     for i:= 0 to j  do
       listbox1.items.add(na(i))
    end;
      

  5.   

    var
     ts :TStringList;ts := TStringList.Create;
    for i:=0 to 12 do
    begin
      ts.Add('');
    end;
    listbox1.items = ts;
      

  6.   

    我的做法是 先定义一个足够大的 MAX,再按 genphone_ru(票票) 的做法,然后再,SetLength一边
      

  7.   

    Delphi的SetLength是可以保护前面定义的数组值的,你可以看看关于SetLength的帮助。