1,for a[1]:=1 to 10 do 
……
为什么出错,是不是for不能使用数组?2,leftstr(const a[i];1); 
为什么出错,a[i]为string类型。3,控件对象create的时候可以定义能数组吗?
不如 a[i]

解决方案 »

  1.   

    1.for i := 0 to 10 do ... 这里的i好象只能单纯整数;
    2.leftstr(const a[i];1); 这里你可传入string数组,直接没用过;
    3.没做过不敢妄答;理论上是可以的
      

  2.   

    1,搞定了,谢谢
    2,leftstr 函数为utilstr类的,知道怎么用了,谢谢
    3,还是不明白,也找不到相关资料,又没高手帮我解释一下,立即给分!!
      

  3.   

    1.For loop control variable must be simple local variable
    2.定义放在函数外面
    3.var memo_var:array[0..2] of Tmemo
      memo_var[0].lines.add('dds');
      

  4.   

    3、可以的,这样:
    var
      button:Tbutton;
      i:integer;
    begin
      for i:=0 to 10 do
        begin
           button:=Tbutton.create(self);
           button.parent:=form1;
           button.left:=i*20;
           button.top:=i*30;
           button.caption:='button'+inttostr(i);
        end;