"Duplicate Definition," CHAIN, Dynamic Array in COMMON (82912)
The information in this article applies to:
- Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0
- Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0a
- Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0b
This article was previously published under Q82912 SUMMARY
CHAINing with a dynamic array in a COMMON statement will give a
"Duplicate Definition" (run-time error 10) at run time if the CHAINed
program attempts to dimension the array again without first erasing
the array.
Dynamic arrays are dimensioned at run time, while static arrays are
dimensioned at compile time. A dynamic array needs to be dimensioned
only once in the executable code; it must be erased before executing
another DIM statement for that array.
The compiler in QuickBasic allows you to make some arrays static
(with DIM STATIC) and some arrays dynamic in a program. You can
also choose the "Make All Arrays Static" option from the Options
item in the Run menu.
Arrays are always dynamic in the interpreter in QuickBasic. The
interpreter does not support static arrays. Dynamic arrays cannot be
redimensioned unless you first perform an ERASE. The ERASE statement
removes a dynamic array from memory.
This information applies to Microsoft QuickBasic versions 1.0, 1.0a,
and 1.0b for Apple Macintosh.
Modification Type: | Major | Last Reviewed: | 10/20/2003 |
---|
Keywords: | KB82912 |
---|
|