Results 1 to 3 of 3

Thread: General string questions

  1. #1

    Thread Starter
    Hyperactive Member maxl's Avatar
    Join Date
    Jan 2002
    Location
    Montréal
    Posts
    384

    General string questions

    Just to know:
    -What is the maximum lenght a string can have ?
    -When you don't specify a lenght for your string, does VB reserve a predefined space or does it allows the memory for the need of the string?
    COBOL sa suce !!!

  2. #2
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046
    someone said the limit was based on RAM. It is essentially more than youll ever need tho. not sure about memory allocation, but my guess is that it is dynamic.

  3. #3
    WorkHorse
    Guest
    MSDN:

    String Data Type
    There are two kinds of strings: variable-length and fixed-length strings.

    · A variable-length string can contain up to approximately 2 billion (2^31) characters.
    · A fixed-length string can contain 1 to approximately 64K (2^16) characters.

    Note A Public fixed-length string can't be used in a class module.

    The codes for String characters range from 0–255. The first 128 characters (0–127) of the character set correspond to the letters and symbols on a standard U.S. keyboard. These first 128 characters are the same as those defined by the ASCII character set. The second 128 characters (128–255) represent special characters, such as letters in international alphabets, accents, currency symbols, and fractions.The type-declaration character for String is the dollar sign ($).
    My understanding is that VB allocates memory for the length of the string as needed. So if it is fixed length, it allocates space and occupies memory for that length, whether it needs it or not.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width