FIX: Erase Won't Clear Contents of Huge Fixed Array as VariantLast reviewed: October 30, 1997Article ID: Q99457 |
2.00 3.00
WINDOWS
kbenv kbbuglist
The information in this article applies to: - Standard and Professional Editions of Microsoft Visual Basic programming system for Windows, versions 2.0 and 3.0
SYMPTOMSThe Erase statement fails to erase huge static arrays of type Variant. This problem occurs with the Variant data type only. The problem does not occur if the size of the array is less than 64K or if you use a huge dynamic array of type Variant.
CAUSEThis problem occurs with huge static arrays of the variant data type. An array is static when you dimension it with the Static keyword or if you use the DIM keyword to dimension the array in the general-declaration section of a form or module. The problem occurs because the Erase statement corrupts the array descriptor for a huge static array of variants. However, only the references to the 64K data segments other than the first segment are corrupted. Any elements in the first 64K segment of the array are always erased properly. All elements stored in other segments are not erased. The Erase statement is only effective the first time you erase the elements of a huge static variant array. Any additional attempt to Erase elements of the array will fail and the elements in the array in data segments other than the first segment will not be erased.
WORKAROUNDTo work around the problem, clear each element of the array manually by setting each element to Empty. Replace the "Erase a" statement in step 2 shown below with this code:
For i% = 0 to 5000 a(i%) = Empty '** Empty = 0 Next i% STATUSMicrosoft has confirmed this to be a bug in Microsoft Visual Basic version 2.0 for Windows. This problem was corrected in Microsoft Visual Basic version 3.0 for Windows.
MORE INFORMATION
Steps to Reproduce Problem
|
Additional reference words: buglist2.00 fixlist3.00 1.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |