Results 1 to 5 of 5

Thread: Why doesn't...

  1. #1

    Thread Starter
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Angry

    .. LenB return the in-Memory Size of a User Defined Type when you have a dynamic array inside it?
    from MSDN:
    LenB Function Returns in-Memory Size of User-Defined Type
    And it says nothing about dynamic arrays in it. I tested resizing a Integer array inside the UDT and it returned 4 whatever size it was.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Perhaps VB stores the dynamic array as a pointer, so it doesn't take the other memory?
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    A dynamic array is stored as a pointer to the data in it. Pointers are 4 bytes.

  4. #4

    Thread Starter
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Then i got a problem, how do i get the size of the Data?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5
    Frenzied Member
    Join Date
    Jul 1999
    Location
    Huntingdon Valley, PA 19006
    Posts
    1,151

    Do some arithmetic.

    Looks to me as though you need to use Ubound & Lbound functions. Then do some arithmetic. Consult documentation on how much storage required for each item in array.

    By the way, it often pays to use fixed length strings in arrays, avoiding the 10-Byte overhead per string for variable length strings.
    Live long & prosper.

    The Dinosaur from prehistoric era prior to computers.

    Eschew obfuscation!
    If a billion people believe a foolish idea, it is still a foolish idea!
    VB.net 2010 Express
    64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.

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