12.12.2012 Views

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

380 Day 10<br />

NOTE<br />

<strong>C++</strong>Builder comes with a utility that allows you to search for text<br />

across source files. The utility is called grep (for Global Regular<br />

Expression Pr<strong>in</strong>t) and can be found <strong>in</strong> the CBuilder\B<strong>in</strong> directory. This<br />

command-l<strong>in</strong>e program is a powerful search utility. Unfortunately<br />

<strong>C++</strong>Builder does not <strong>in</strong>tegrate grep <strong>in</strong>to the IDE as <strong>Borland</strong> <strong>C++</strong> does.<br />

Still, you can run grep from the command l<strong>in</strong>e or search various onl<strong>in</strong>e<br />

sources for a host of third-party W<strong>in</strong>dows-based grep tools.<br />

Gett<strong>in</strong>g Help<br />

One of the most useful features of the Code Editor is its <strong>in</strong>tegration with the <strong>C++</strong>Builder help<br />

system. Just place the editor cursor over a <strong>C++</strong> keyword, a VCL property or method, or any<br />

other <strong>C++</strong>Builder-specific text and press F1. If a help topic for the text under the cursor exists<br />

<strong>in</strong> the <strong>C++</strong>Builder help files, W<strong>in</strong>Help will run with the appropriate page show<strong>in</strong>g. If no help<br />

topic exists for the selected text, an error message will be displayed. This feature is extremely<br />

useful when you can’t remember how to use a particular aspect of <strong>C++</strong>Builder, <strong>C++</strong>, or VCL.<br />

Help, as they say, is just a keystroke away.<br />

Specialized Editor Features<br />

The <strong>C++</strong>Builder Code Editor has a few features that are extremely useful when you are<br />

writ<strong>in</strong>g a lot of code. They are expla<strong>in</strong>ed <strong>in</strong> the follow<strong>in</strong>g sections.<br />

Us<strong>in</strong>g Bookmarks<br />

You can set bookmarks <strong>in</strong> your code to temporarily mark your place <strong>in</strong> a source file. For<br />

example, you often have to temporarily leave a block of code you are work<strong>in</strong>g on to review<br />

previously written code or to copy code from another location. By dropp<strong>in</strong>g a bookmark at<br />

that po<strong>in</strong>t <strong>in</strong> your code before runn<strong>in</strong>g off to do your other work, you can return to that<br />

section of code with a simple keystroke. You can have up to 10 bookmarks set at any one time.<br />

To set a bookmark at a particular location, press Ctrl+Shift and the number of the bookmark<br />

to set. For example, to set bookmark 0 (the first bookmark), place the editor cursor at the<br />

location you want to mark and then press Ctrl+Shift+0. When you set a bookmark, an icon<br />

is placed <strong>in</strong> the Code Editor gutter to <strong>in</strong>dicate that a bookmark exists on that l<strong>in</strong>e. The icon<br />

shows the number of the bookmark. Figure 10.13 shows the Code Editor with a bookmark<br />

dropped on a l<strong>in</strong>e.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!