INFO: LenB Returns in-Memory Size of User-Defined TypeLast reviewed: September 29, 1997Article ID: Q137729 |
The information in this article applies to:
SUMMARYLenB function returns the in-memory size of a user-defined type (UDT).
MORE INFORMATIONVisual Basic 32-bit structures are DWORD aligned (four bytes) when stored in memory. Fixed-length strings use two bytes for every character to account for UNICODE. String descriptors use four bytes each. Integers use two bytes. Please refer to the Visual Basic Help file for the lengths of all the other data types.
Example OneConsider this example UDT:
Type Generic
FirstName as String * 5
LastName as String
ChildrenAges (1 to 5) as Byte
End Type
This UDT requires the following number of bytes:
LenB(Generic) = 21 Len (Generic) = 14 Example TwoConsider this example UDT:
Type Generic
FirstName as String * 7
LastName as String * 6
ChildrenAges (1 to 5) as Byte
Address * String
End Type
This UDT requires the following number of bytes:
LenB(Generic) = 36 Len (Generic) = 22 Keywords : PrgOther vb432 VB4WIN vbwin GnrlVb kbenv kbprg Technology : kbvba Version : WINDOWS:4.0 Platform : WINDOWS Issue type : kbinfo |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |