Microsoft KB Archive/32223

= Mac BASIC Interpreter Allocates DYNAMIC Arrays, Never STATIC =

Article ID: 32223

Article Last Modified on 11/21/2006



This article was previously published under Q32223



SUMMARY
The interpreter in QuickBASIC Version 1.00 for Macintosh supports only DYNAMIC arrays. (The same is true for the BASIC interpreter Versions 3.00 and earlier.) The compiler supports both STATIC and DYNAMIC arrays.

The STATIC keyword in a DIM statement is ignored by the QuickBASIC interpreter, and the array is made DYNAMIC. In the older BASIC interpreter Versions 3.00 and earlier, the DIM STATIC statement gives a &quot;Syntax Error&quot; message when executed and does not dimension the array.



MORE INFORMATION
STATIC arrays are allocated space at compile time, and cannot be removed from memory with the ERASE statement. Accessing STATIC arrays is faster than accessing DYNAMIC arrays.

DYNAMIC arrays are allocated space at run time, and can be removed from memory with the ERASE statement, which allows more flexible memory management than STATIC arrays when memory is tight. Using DYNAMIC arrays in a program makes it slower than if it were using STATIC arrays.

Although you may use DIM STATIC in the QuickBASIC interpreter, it allocates only DYNAMIC arrays. The STATIC keyword in a DIM statement is ignored by the QuickBASIC interpreter. Because either of the compiler formats would be acceptable under the QuickBASIC interpreter, Microsoft recommends following the rules for the compiler.

Additional query words: MQuickB

Keywords: KB32223

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.