Q38493: CodeView Problem Stepping into BASIC GOSUB Compiled /X or /D
Article: Q38493 Product(s): See article Version(s): 4.50 Operating System(s): MS-DOS Keyword(s): ENDUSER | S_CodeView B_BasicCom buglist4.00 buglist4.00b buglist4.50 | mspl13_basic Last Modified: 20-SEP-1990 If you compile the program below with BC /X or /D in addition to the /Zi option (and then LINK with /CO) for Microsoft CodeView compatibility, the GOSUB subroutine cannot be "stepped into" in CodeView (using the F8 key in CV.EXE). The CodeView stepping-in process works correctly if the program is compiled without /X and without /D. The compiler switch /X is needed to do error trapping using ON ERROR with RESUME statements. 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. Microsoft has confirmed this to be a problem in Microsoft QuickBASIC versions 4.00, 4.00b, and 4.50; in Microsoft BASIC Compiler versions 6.00 and 6.00b for MS-DOS and MS OS/2 (buglist6.00, buglist6.00b); and in Microsoft BASIC Professional Development System (PDS) versions 7.00 and 7.10 for MS-DOS and MS OS/2 (buglist7.00, buglist7.10). We are researching this problem and will post new information here as it becomes available. Code Example ------------ CLS PRINT "Point 1" GOSUB 100 PRINT "Point 3" END REM * Subroutine * 100 PRINT "Point 2" 200 RETURN
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
Copyright Microsoft Corporation 1986-2002.