TECH TIP: Break - Edit - Continue alternatives
VB.Net has dropped the BEC (Break, Edit, and Continue) functionality,
but there are alternatives that will assist in debugging. Using the Command
window in Immediate mode, the values of some of the variables can be
changed. This procedure alone can help you get through buggy code by
inserting more correct values where needed.
To change a variable, select View/Other Windows/Command Window from
the IDE menu, then enter 'immed' after the prompt in the command window.
You can then issue commands from the current development language by
typing in the command and pressing Enter. (Help says '>' is needed ahead of
the command, I found otherwise using VB.Net.)
After inserting valid values, you are able to continue on to more debugging
if necessary. There are times, however, that a rewrite of a section of code
needs to be done. The IDE won't let you add or change code while the
program is running, but you really don't want to forget where it was, or what
it was that needed doing. Again, to get by that section temporarily, you can alter
a few values, but to remember where that section is located, you can add a
bookmark that will show up in the task list.
To add a bookmark to the task list, right click on the left margin of the code
window, at the place you want to return to, then select 'Add Task List Shortcut'
from the context menu. Open the Task List if it is not already open
(View/Other Windows/Task List) then edit the Description field of the new task
to indicate what must be done at that location.
Using the Immediate window will let you call into your code, to test a function,
plus other uses, so the only thing lacking from the classic BEC functionality is the
ability to write new code while your program is running. Unless your a seat-of-your-
pants type of coder, you might want to consider the ramifications any new code
will have on other areas of your project before making changes. Having to stop the
program, and cycling through the Task List may help remind you to consider what
you are going to change, before making the change permanent. In essence, the RAD
funtionality of BEC is not lost, you just have to get used to a few new processes!
<VS Editors - You may publish this tip free of charge, all I ask is that you credit the
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL