Microsoft KB Archive/40631

= QB.EXE 4.x Won't Trace or Single Step through KEY Routine =

Article ID: 40631

Article Last Modified on 11/21/2006



This article was previously published under Q40631



SYMPTOMS
When single stepping or tracing through a program, the QB.EXE Version 4.00, 4.00b, or 4.50 editor executes key-trapping or event-trapping routines correctly, but fails to display the tracing through the routine unless you place a breakpoint there.



STATUS
Microsoft has confirmed this to be a bug in Versions 4.00 and 4.00b. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

QuickBasic Version 3.00 successfully displays the single stepping or tracing through key-trapping or event-trapping routines.



MORE INFORMATION
This article applies to all forms of ON Event GOSUB, where the Event can be COM(n), KEY(n), PEN, PLAY(q), STRIG(n), and TIMER(n).

To trace through a program in QuickBasic Versions 4.x, choose the Debug menu, toggle the Trace On option, and run the program. (In QuickBasic Version 3.00, insert the statement TRON as the first statement of the program and run it.)

To Single Step through a program in QuickBasic Versions 4.x, press F8 repeatedly. (In QuickBasic Version 3.00, you need to choose DEBUG from the Run menu, then press F8 repeatedly.)

When you single step or trace the program below in the QuickBasic Versions 4.00, 4.00b, and 4.50 editors, press F1 or F2 while the program is waiting for INPUT activates the key-trapping routine. After you press ENTER to terminate the INPUT, the editor executes the key-trapping routine but does not display the single stepping or tracing.

To work around this behavior, set a breakpoint at the label of the key-handling routine to stop execution at the label. Then, the QB.EXE editor correctly single steps or traces through the key routine. You can press F5 to continue tracing or press F8 for single stepping.

The following is a code example: ON KEY(1) GOSUB KeyRoutine1 ON KEY(2) GOSUB KeyRoutine2 KEY(1) ON KEY(2) ON WHILE 1 INPUT &quot;Press F1 or F2 and then hit ENTER key&quot;, X$ WEND END KeyRoutine1: 'Must set a breakpoint here to single step 'or trace through this routine. PRINT &quot;inside key routine 1&quot; RETURN KeyRoutine2: 'Must set a breakpoint here to single step 'or trace through this routine. PRINT &quot;inside key routine 2&quot; RETURN

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

Keywords: KB40631

-

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

© Microsoft Corporation. All rights reserved.