Microsoft KB Archive/38493

= CodeView Problem Stepping into Basic GOSUB Compiled /X or /D =

Article ID: 38493

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft QuickBasic 4.0, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft QuickBASIC 4.0b, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft QuickBasic 4.5 for MS-DOS, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft BASIC Compiler 6.0
 * Microsoft BASIC Compiler 6.0b
 * Microsoft BASIC Professional Development System 7.0
 * Microsoft BASIC Professional Development System 7.1

-



This article was previously published under Q38493



SYMPTOMS
If you compile the program below with BC /X or /D or /E in addition to the /Zi option (and then LINK with /CO) for Microsoft CodeView compatibility, the GOSUB subroutine cannot be &quot;stepped into&quot; in CodeView (using the F8 key in CV.EXE). The CodeView stepping-in process works correctly if the program is compiled without /X, without /D, and without /E. (The compiler switch /X is needed to do error trapping using ON ERROR with RESUME statements.)



WORKAROUND
To work around this limitation, do the following:
 * 1) When the GOSUB is encountered, switch the View option to mixed mode and step through lines in mixed mode until the subroutine is reached, then switch back to Basic mode.
 * 2) When the RETURN statement is reached, go back into mixed mode until you are back to the line after the GOSUB.



STATUS
Microsoft has confirmed this to be a bug in Microsoft QuickBasic versions 4.0, 4.0b, and 4.5; in Microsoft Basic Compiler versions 6.0 and 6.0b for MS-DOS and MS OS/2 (buglist6.00, buglist6.00b); and in Microsoft Basic Professional Development System (PDS) versions 7.0 and 7.1 for MS-DOS and MS OS/2 (buglist7.00, buglist7.10). We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



Code Example
CLS PRINT &quot;Point 1&quot; GOSUB 100 PRINT &quot;Point 3&quot; END

REM * Subroutine * 100 PRINT &quot;Point 2&quot; 200 RETURN

Additional query words: QuickBas BasicCom 4.00 4.00b 4.50 6.00 6.00b 7.00 7.10 buglist4.00 buglist4.00b buglist4.50

Keywords: KB38493

-

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

© Microsoft Corporation. All rights reserved.