Microsoft KB Archive/32790

= &quot;Statement Not in a Subprogram Block&quot;; Order SUBs Last =

Article ID: 32790

Article Last Modified on 11/21/2006



This article was previously published under Q32790



SUMMARY
The compile-time error message &quot;Statement not in a subprogram block&quot; occurs in QuickBASIC for the Macintosh when compiling a program in which main-level code occurs after a subprogram (SUB...END SUB) definition. The Macintosh BASIC interpreter allows subprogram (SUB...END SUB) blocks to be interspersed within main level code; however, in compiled programs, all subprogram declarations must come after the main program.

To move the subprograms to the end of the program, you may do either of the following:


 * 1) Cut and paste in the QuickBASIC editor.
 * 2) Run &quot;SortSub&quot; (provided on the Macintosh QuickBASIC release disk) or the compiled version &quot;SortSub apl&quot;. Note that &quot;SortSub&quot; can only sort programs that are saved as text. &quot;SortSub&quot; renames the original program (by giving it an extension) and gives the sorted program the original program name.

Additional query words: MQuickB

Keywords: KB32790

-

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

© Microsoft Corporation. All rights reserved.