The information in this article applies to:
SYMPTOMSWhen used with a user-defined type, the LenB function may return a different value than the Len function on 32-bit Windows platforms. This behavior occurs because the LenB function returns the in-memory size of a type, while the Len function returns the amount of size that a UDT would take if stored on disk. This occurs because Visual Basic 4.0 32-bit represents strings internally in Unicode, but externally (on disk) as ANSI. A string in the two-byte Unicode standard will occupy twice as much space as its ANSI equivalent. STATUSThis behavior is by design. MORE INFORMATIONThe reproduction sample below demonstrates this behavior. Note that the fixed-length string is what causes different values for Len and LenB. The non-fixed-length string will always return a value of 4, because that is the space required to store a pointer to the location where the actual string is stored. The array of bytes of size five needs 5 bytes of storage, regardless of the contents of the array. Steps to Reproduce
Additional query words:
Keywords : kbprg kbVBp400 IAPVBA VB4WIN vbwin kb32bitOnly |
Last Reviewed: October 21, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |