• Keine Ergebnisse gefunden

Browsing through your code

Im Dokument or an (Seite 29-33)

The Browser has a customizable SpeedBar (see page 12 for more information on customizing SpeedBars).

16

The browser lets you view the object hierarchies, classes, functions, variables, types, and constants your program uses. The browser also lets you

• Graphically view the hierarchies in your application, then select the object of your choice and view the functions and symbols it contains and inherits.

• List the variables your program defines, then select one and view its declaration, list all references to it in your program, or edit its declaration in your source code.

Before you use the browser, be sure to set these options in the Project Options dialog box (choose Options I Project) and compile your application:

• Choose Compiler I Debugging and check Debug information in OBJs

• Choose Compiler I Debugging and check Browser reference information in OBJs

• Choose Linker I General and check Include debug information.

To start the browser, choose Search I Browse Symbol, View I Classes, or View I Globals. You can also place your cursor on a symbol in your code and choose Search I Browse symbol to bring up the browser. If the program in the current editor window hasn't been compiled yet, you must compile and link your program with debugging information before you can use the browser. If you try to browse a class definition (or any symbol that doesn't have symbolic debug information), you'll get an error message.

Borland C++ Users Guide

Browsing through objects (class overview)

Figure 1.2 Viewing classes in an application

Filters

You can also check the Browser options in the Environment Options dialog box to select the type of symbols, but you must set these options before opening browser windows.

You can set several browser options using the Environment Options dialog box. Choose Options I Enviro.nment, click the Browser topic and select the options you want to use. Single window means you can only have only one browser window up at a time; Multiple windows opens a' new browser window each time you perform a browsing action (such as choosing View I Globals from the main menu). Visible symbols are described on page 18.

Choose View I Classes to see the "big picture," the object hierarchies in your application, as well as the small details. When you choose View I Classes, the browser draws your objects and shows their ancestor-descendant relationships in a horizontal tree. The red lines in the hierarchy help you see the immediate ancestor-descendant relationships of the currently selected object more clearly. Figure 1.2 shows the structure of the WHELLO application.

To see more information on a particular object, double-click it. If you aren't using a mouse, select the object by using your arrow keys and press Enter.

When you browse a particular symbol, the same letters that identify the symbol appear in a Filters matrix at the bottom of the browser window.

You can use filters to select the type of symbols you want to see listed. (See Table 1.1 for a list of letters and their meaning.)

The Filters matrix has a column for each letter. Click the top or bottom row to move the letter (a letter in the top row means the browser shows

symbols with that identification; a letter on the bottom means the browser excludes symbols with that identification).

To restrict views of a particular type of symbol, click the bottom cell of the letter's column as shown at left. For example, to remove all the variables displayed in the currently selected object, click the bottom cell in the

v-column.

In some cases more than one letter appears next to a symbol. The second letter appears just after the letter identifying the type of symbol and further describes the symbol. See Table 1.1 for a list of filter identifiers.

Viewing declarations of listed symbols

Figure 1.3 Symbol declaration window

Browsing through global symbols

Figure 1.4 Viewing globals

Use one of these methods to see the declaration of a particular symbol displayed in a list:

• Double-click the symbol.

• Select the symbol and press Enter.

• Select the symbol, press Alt+F10 to view the SpeedMenu, then choose Browse Symbol.

The symbol declaration appears in a window, as shown in Figure 1.3.

Choose View I Globals to open a window that lists every global symbol in your application in alphabetical order. The browser lists the symbols (the functions, variables, and so on) used in the object. Figure 1.4 shows the globals for the WHELLO program.

One or more letters appear to the left of each symbol in the object. The ,letters describe what kind of symbol it is. You can filter out symbols using

the filter list at the bottom of the browser window. See the previous section

"Filters" for more information.

Borland C++ Users Guide '

Table 1.1 Letter symbols in the Browser

You can also type regular expressions for searching (for example, you can use

?, * and t).

Using regular expressions in the browser

Table 1.2 Browser search expressions

Letter Symbol F Functions

T Types

V Variables C Integral constants

? . Debuggable

Inherited from an ancestor v Virtual method

To get more information on a particular symbol, either click the symbol or use your cursor keys to select it. A Search input box at the bottom of the window lets you'quickly search through the list of global symbols by typing the first few letters of the symbol's name. As you type, the highlight bar in the list box moves to a symbol that matches the typed characters.

You can view the symbol declaration by selecting the symbol and pressing Enter. See the previous section, "Viewing declarations of listed symbols," for more information.

You can use expressions in the search box in some browser windows. See Table 1.2 for a list of the symbols allowed.

Character Function

Matches one of any character.

Matches zero or more of the previous character. For example,

* is an error because there is no previous character fo* matches anything starting with an "f"

fo*x matches "fx", "fox","fooox"

t Matches one or more of the previous character. For example,

t is an error

?

fot matches anything starting with "fo"

fotx matches "fox", '1000x"

Matches zero or one of the previous character. For example,

? is an error

f o? matches anything starting with "f"

fo?x matches only "fx" or "fox"

Browsing symbols in your code

You can also browse any symbol'in your code without viewing object hierarchies or lists of symbols first. Choose from these methods:

• Highlight the symbol in your code and choose Search I Browse Symbol.

• Click the right mouse button or press Alt+F10when an editor window is selected to display the SpeedMenu, then choose Browse Symbol.

Im Dokument or an (Seite 29-33)