Microsoft KB Archive/41396

= In QB, &quot;Blank lines Not Allowed before SUB/FUNCTION&quot; Misleads =

Article ID: 41396

Article Last Modified on 11/21/2006



This article was previously published under Q41396



SYMPTOMS
In the QB.EXE editor in QuickBasic Versions 4.00, 4.00b, and 4.50, if the syntax of the parameter list in a SUB or FUNCTION statement is incorrect and the ENTER key is used to move to the next line, the following misleading error message is displayed:

&quot;Blank lines not allowed before SUB/FUNCTION line. Is Remark OK?&quot;

If you select the &quot;OK&quot; option, a remark (') line is inserted AFTER the SUB or FUNCTION line, and the correct error message is then displayed. The message may differ based on what the actual error is.

If you use the Mouse or ARROW keys (instead of the ENTER key) to move to the next line, the correct error message will then display. (You will not receive the incorrect error message, and a remark line will not be inserted after the SUB or FUNCTION line.)



STATUS
Microsoft is researching the initially misleading error message and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
When using the ENTER key to move to the next line, the QuickBasic Environment will not allow you to leave the SUB/FUNCTION line until the syntax error has been corrected. However, you can move to another line using the Mouse or ARROW keys without correcting the error.

Moving to another line without correcting the error in a SUB or FUNCTION line is not a good idea. Various editing steps within the same window following this can cause unexpected results. The following example will hang the machine:

  Type in the following program: CALL test(X) SUB test(X) PRINT END SUB (The Subprogram is displayed in its own window.)   Edit the SUB statement so that it is incorrect (e.g. by deleting the right parenthesis): SUB test(X                        Press the ENTER key to produce the events described above. Attempt to enter another SUB or FUNCTION statement following the END SUB statement. You will receive one or two incorrect error messages as described previously. You will then receive one or two correct messages:

&quot;END SUB or END FUNCTION must be last statement in window&quot;

</li> If you ignore the messages and enter the SUB or FUNCTION statement, the machine will hang, possibly requiring a cold boot.</li></ol>

Additional query words: QuickBas buglist4.00 buglist4.00b buglist4.50

Keywords: KB41396

-

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

© Microsoft Corporation. All rights reserved.