TStringList的长度有限制吗?

解决方案 »

  1.   

    ----------------------------------------------------------------------------------------
    A string represents a sequence of characters. Object Pascal supports the following predefined string types.Type Maximum length Memory required Used for
    ShortString 255 characters 2 to 256 bytes backward compatibility
    AnsiString ~2^31 characters 4 bytes to 2GB 8-bit (ANSI) characters
    WideString ~2^30 characters 4 bytes to 2GB Unicode characters; 
    multiuser servers and multi-language applications
    ---------------------------------------------------------------------------------------这是在Delphi帮助里,关于String的说明,一个string都可以放2GB的东西
    理论上TStringlists是无限的,就看你的机器内存有多大了
      

  2.   

    AnsiString, also called a long string, represents a dynamically allocated string whose maximum length is limited only by available memory. 
    string应该是2G.
    AnsiString不受限制
      

  3.   

    有点迷糊了...
    谁来讨论一下?另外纠正一下 dongliu(一沙一世界,一花一天堂) 
    ------------------
    creates a variable S that holds a string. In the default {$H+} state, the compiler interprets string (when it appears without a bracketed number after it) as AnsiString. Use the {$H–} directive to turn string into ShortString.
    -------------------一般来说string就是ansistring,二者没有区别
      

  4.   

    请注意:我们讨论的是Tstringlist,不是string
      

  5.   

    ---------------------------------------
    回复人: chiengod(钱神爷) ( ) 信誉:100  2005-07-01 17:36:00  得分: 0  
     
     
       请注意:我们讨论的是Tstringlist,不是string
      
    ---------------------------------------楼主不会举一反三啊,
    TStringList可以放无限个string
    不管string是2G还是无限制,TStringLis长度都是无限制的
    如果楼主只是要听这么一句的话,可以结帖了