动态数组怎么实现动态增加长度?  
比如我先SetLength(A,10);  
 但是到后面时,可能遇到10不够长,想再增加一点长度,但是前面的数据又不清除,要怎么处理?

解决方案 »

  1.   

    setLength
    建议你用STRINGLIST,好简单的
      

  2.   

    再SetLength为什么可以呢,为什么不会初始化为0呢!???
      

  3.   

    BorLand 在SetLength中已处理
    发现以前长度不为0,重新分配新长度,再复制旧数据,再free旧数据占用空间
      

  4.   

    For a long-string or dynamic-array variable, SetLength reallocates the string or array referenced by S to the given length. Existing characters in the string or elements in the array are preserved, but the content of newly allocated space is undefined.
      

  5.   

    还是谢谢jinjazz(人雅的标记--落寞刺客),可是已经没分了,抱歉!!