Microsoft KB Archive/58037

= Can't READ DATA Statements Across Basic Modules =

Article ID: 58037

Article Last Modified on 8/16/2005

-

APPLIES TO


 * Microsoft QuickBasic 4.0
 * Microsoft QuickBASIC 4.0b
 * Microsoft QuickBasic 4.5 for MS-DOS
 * Microsoft BASIC Compiler 6.0
 * Microsoft BASIC Compiler 6.0b
 * Microsoft BASIC Professional Development System 7.0

-



This article was previously published under Q58037



SUMMARY
The READ statement cannot read DATA statements that are in another module. READ statements are allowed within subprograms, but will only read DATA statements that are in the same module that the subprogram is in. DATA statements themselves cannot be included inside SUB or FUNCTION procedure definitions; they must be located at the module level code of each module.

This information applies to Microsoft QuickBasic Versions 4.00, 4.00b, and 4.50 for MS-DOS, to Microsoft Basic Compiler Versions 6.00 and 6.00b for MS-DOS and MS OS/2, and to Microsoft Basic Professional Development System (PDS) Version 7.00 for MS-DOS and MS OS/2.



MORE INFORMATION
If a READ statement is executed and there are no DATA statements in that module, an &quot;Out of data&quot; error is generated. The READ statement does not look for DATA statements in other modules. This limitation of the READ statement is not explicitly stated in any documentation. This information needs to be added to the READ and DATA statements (listed alphabetically) in the following manuals:


 * 1) &quot;Microsoft QuickBasic 4.5: Basic Language Reference&quot; for Version 4.50
 * 2) &quot;Microsoft QuickBasic 4.0: Basic Language Reference&quot; manual for Versions 4.00 and 4.00b
 * 3) &quot;Microsoft QuickBasic Compiler&quot; Versions 2.0x and 3.00 manual
 * 4) &quot;Microsoft Basic Version 7.0: Language Reference&quot; manual
 * 5) &quot;Microsoft Basic Compiler 6.0: Basic Language Reference&quot; for Versions 6.00 and 6.00b

Additional query words: QuickBas BasicCom

Keywords: KB58037

-

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

© Microsoft Corporation. All rights reserved.