DIMension in a FOR-NEXT Loop Is Possible (61440)
The information in this article applies to:
- Microsoft QuickBASIC 4.0
- Microsoft QuickBASIC 4.0b
- Microsoft QuickBASIC 4.5
- Microsoft Basic Professional Development System for MS-DOS 7.0
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
This article was previously published under Q61440 SUMMARY
Microsoft QuickBasic allows you to correctly DIMension a static array
within a loop (FOR, WHILE, or DO). This is possible because a DIM of a
static array happens as the program is being compiled (or during the
binding phase in the interpreter). DIM on a static array is not an
executable statement. Even though the DIM appears in a loop, it is not
being executed over and over as the loop iterates. Each time the loop
executes, the array is not being redimensioned. Therefore, any values
inserted into the array are not lost.
This information applies to Microsoft QuickBasic versions 4.00, 4.00b,
and 4.50, to Microsoft Basic Compiler versions 6.00 and 6.00b, and to
Microsoft Basic Professional Development System (PDS) version 7.00.
Modification Type: | Minor | Last Reviewed: | 8/16/2005 |
---|
Keywords: | KB61440 |
---|
|