Microsoft KB Archive/31882

= DATA Statements Not Allowed in SUB or FUNCTION Procedures =

Article ID: 31882

Article Last Modified on 11/21/2006



This article was previously published under Q31882



SUMMARY
The DATA statement should be included in the list of statements prohibited in procedure-level code on Page 50 of the following manuals


 * 1) &quot;Microsoft QuickBasic 4.0: Programming in Basic: Selected Topics&quot;
 * 2) &quot;Microsoft Basic Compiler 6.0: Programming in Basic: Selected Topics&quot;
 * 3) Page 41 of the &quot;Microsoft Basic 7.0: Programmer's Guide&quot; manual.



MORE INFORMATION
The DATA statement documentation on Page 135 in the Basic language reference manual correctly states that &quot;DATA statements can only be entered in the module-level code.&quot;

A module is defined as an individual source file, but &quot;module level&quot; is a special term with a different meaning. The glossary on Page 350 of the &quot;Microsoft QuickBasic 4.0: Learning and Using QuickBasic&quot; manual defines &quot;module-level code&quot; as follows:

(Module-level code is defined as) program statements within any module that are outside a SUB or FUNCTION definition. Error- or event-handling code and declarative statements such as COMMON, DECLARE, and TYPE can appear only at the module level.

Additional query words: QuickBas BasicCom

Keywords: KB31882

-

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

© Microsoft Corporation. All rights reserved.