Getting Started with CodeView in Visual Basic for MS-DOS

ID: Q95180


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for MS-DOS, version 1.0


SUMMARY

The CodeView debugger that comes with the Professional Edition of Visual Basic for MS-DOS is useful for debugging mixed language programs. Do not use it with a program written completely in Visual Basic for MS-DOS. The VBDOS.EXE interpreter environment is more suited for that purpose.

The following information is a supplement to Chapter 10 of the Professional Edition of the "Microsoft Visual Basic for MS-DOS Professional Features" manual.


MORE INFORMATION

The first Step in preparing your program for the CodeView debugger is to compile each module in your program with the /Zi option. This includes non-Basic modules. You can compile Basic modules with this option from the interpreter environment by choosing Make EXE File from the Run menu and adding the /Zi option under Additional Options. Note, you must have saved your source files as text or you get a compile-time error.

When you use LINK to link your program together, you must use the /CO option. The interpreter environment adds this option automatically if you added the /Zi option, but you may not be able to debug your program correctly because of the other additions the environment makes, so it's a good idea to link it from the MS-DOS command prompt with the /CO option:

LINK /CO PROGRAM.OBJ;
After your program is compiled, start CodeView by typing CV followed by the name of your executable program:
CV PROGRAM.EXE
Once in the CodeView environment, load the code module that contains the code you want to debug. To do this, from the File menu, choose Open Module and select the module that contains the code you want to debug. Once the code is in view, set a breakpoint by pressing the F9 key on the specific line of code where you want execution to stop. If the source code line you choose can't have a breakpoint, the computer will beep when you try to put a breakpoint on it.

When debugging the code in a form, you must scroll down past the property and control definitions (BEGIN ... END).

Now you are ready to debug your program. To start your program, press the F5 key just as you would in the VBDOS.EXE interpreter environment. When execution reaches your breakpoint, your program halts and the source window is displayed. To step through this part of your program, press the F8 key just as you would in the VBDOS.EXE interpreter environment.

For more information, see Chapter 10 of the Professional Edition of the "Microsoft Visual Basic for MS-DOS Professional Features" manual.

Additional query words: VBmsdos 1.00 s_codeview 4.02

Keywords :
Version : MS-DOS:1.0
Platform : MS-DOS
Issue type :


Last Reviewed: December 9, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.