Datasheet

For example, you can place several related subroutines in a region so you can collapse and expand the
routines as a group.
Figure 1-55 shows more examples of outlining. Line 36 begins a region named
Randomization Functions
that contains three collapsed subroutines. Notice that the corresponding End Region statement includes
a comment giving the region’s name. This is not required but it makes the code easier to understand when
you are looking at the end of a region.
Line 89 contains a collapsed region named
Utility Functions.
Line 95 starts a module named
HelperRoutines that contains one collapsed subroutine.
Finally, Line 114 holds the collapsed
ImageResources namespace.
Notice that the line numbers skip values for any collapsed lines. For example, the
RandomizeIntegerArray subroutine is collapsed on line 38. This subroutine contains 15 lines
(including the
Sub statement), so the next visible line is labeled 53.
Also notice that comments before a subroutine are not collapsed with the subroutine. You can make read-
ing collapsed code easier by placing a short descriptive comment before each routine.
Figure 1-55: The code editor outlines namespaces, classes and their methods, modules and their
methods, and regions.
58
Part I: Getting Started
37055c016.qxd 4/8/07 12:46 PM Page 58