Microsoft KB Archive/63008

= DEFINT A: DEFLNG B Before SUB Gives &quot;Cannot Precede SUB&quot; in QB =

Article ID: 63008

Article Last Modified on 11/21/2006



This article was previously published under Q63008



SYMPTOMS
Placing two DEFtype statements (DEFINT, DEFLNG, DEFSNG, DEFDBL, DEFSTR, or DEFCUR) on the same line separated by a colon incorrectly gives the error &quot;Statement cannot precede SUB/FUNCTION definition&quot; in QB.EXE and &quot;Invalid statement preceding SUB/FUNCTION definition&quot; in QBX.EXE. The BC.EXE compiler correctly compiles this line without error.

To work around this problem, place each DEFtype on a separate line before the SUB/FUNCTION line.



STATUS
Microsoft has confirmed this to be a bug in the QB.EXE environment of Microsoft QuickBasic versions 4.00, 4.00b, and 4.50; in the QB.EXE environment of Microsoft Basic Compiler versions 6.00 and 6.00b for MS-DOS (buglist6.00, buglist6.00b); and in the QBX.EXE environment of Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10 for MS-DOS (buglist7.00, buglist7.10). We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
To reproduce this problem, add the following line before any SUB or FUNCTION in the QB.EXE or QBX.EXE environment: DEFINT A:DEFLNG B The resulting SUB will appear as follows: DEFINT A:DEFLNG B  SUB test ...  END SUB To work around this problem, enter each DEFtype as a separate line, as follows: DEFINT A  DEFLNG B   SUB test ...  END SUB Note that if you load a program resembling this into the QB.EXE or QBX.EXE editor, the editor will automatically put each DEFtype statements on its own line and remove the colon.

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

Keywords: KB63008

-

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

© Microsoft Corporation. All rights reserved.