Datasheet

The Code Editor at Runtime
The code editor behaves slightly differently at runtime and design time. Many of its design time features
still work. Breakpoints, bookmarks, IntelliSense, and snippets still work.
At runtime, the editor adds new tools for controlling the program’s execution. Right-click a value and
select Add Watch or QuickWatch to examine and monitor the value. Use the Stop Into, Step Over, and
Step Out commands on the Debug menu or toolbar to make the program walk through the code.
Right-click a statement and select Show Next Statement to move the cursor to the next statement that the
program will execute. Select Run To Cursor to make the program continue running until it reaches the
cursor’s current line.
Right-click and select Set Next Statement to make the program jump to a new location. You can also drag
the yellow arrow indicating the next statement to a new location in the left margin. There are some restric-
tions on where you can move the execution position. For example, you cannot jump out of one routine
and into another.
You can discover other runtime features by exploring the editor at run time. Right-click on different parts
of the editor to see which commands are available in that mode.
Summary
The Visual Studio integrated development environment provides many tools for writing and debugging
applications. It provides code snippets that make saving and reusing code easy. It lets you add, remove,
and disable complex breakpoints that check conditions and hit counts, and that can perform customized
actions. You can use regions and bookmarks to organize and find pieces of code, and you can step through
the code line by line at execution time.
The IDE is extremely flexible. You can show, hide, and rearrange windows; add and remove items from
menus and toolbars; and write macros to automate simple chores. Context menus attached to all sorts of
objects provide help, tools, and other features that make sense for their particular objects and under dif-
ferent situations.
This chapter describes some of the most useful parts of the IDE, but listing every last nook and cranny
would be tedious and not terribly useful. Rather than reading about the IDE further, you would be better
off experimenting with it. Spend a few hours really examining all of the menus. Create a snippet with
some replacement values and then insert it into your code. Step through a small program and try the
Immediate and Command windows.
While you do all this, and while you’re developing real applications, right-click things to see what sort
of context menus they provide. The IDE is packed with so many tools that it is sometimes hard to find
the one you want. Because context menus are tied closely to the objects that you click to display them,
they often provide more appropriate and focused commands than the toolbars or menus.
68
Part I: Getting Started
37055c016.qxd 4/8/07 12:46 PM Page 68










