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.

378 Day 10<br />

TIP<br />

To select a s<strong>in</strong>gle l<strong>in</strong>e of code with the mouse, click at the beg<strong>in</strong>n<strong>in</strong>g of<br />

the l<strong>in</strong>e and drag straight down to the beg<strong>in</strong>n<strong>in</strong>g of the next l<strong>in</strong>e. To<br />

highlight a s<strong>in</strong>gle l<strong>in</strong>e of code with the keyboard, first press the Home<br />

key to move to the beg<strong>in</strong>n<strong>in</strong>g of the l<strong>in</strong>e and then use Shift+downarrow<br />

key to highlight the l<strong>in</strong>e.<br />

There are dozens of keyboard comb<strong>in</strong>ations that can be used to highlight text and do other<br />

edit<strong>in</strong>g chores. For a complete list of all the keyboard shortcuts available, consult the<br />

<strong>C++</strong>Builder onl<strong>in</strong>e help.<br />

TIP<br />

As you program you often add, delete, or move blocks of text. Sometimes<br />

you will need to <strong>in</strong>dent an entire block of code. At other times<br />

you will need to un-<strong>in</strong>dent (outdent?) an entire block of code. To<br />

<strong>in</strong>dent a block of code, highlight the l<strong>in</strong>es that you want to <strong>in</strong>dent and<br />

then press Ctrl+Shift+I on the keyboard. The entire block will be<br />

<strong>in</strong>dented. To un-<strong>in</strong>dent a block of code, press Ctrl+Shift+U on the<br />

keyboard.<br />

Undo<br />

The Code Editor has a virtually limitless number of undo levels (32,767 by default).<br />

Normally, you can only undo commands up to the last time you saved a file. By chang<strong>in</strong>g<br />

the editor options, you will be able to undo past commands even after sav<strong>in</strong>g the file. I’ll talk<br />

about editor options and preferences later <strong>in</strong> the chapter, <strong>in</strong> the section titled “Chang<strong>in</strong>g the<br />

Editor Options.”<br />

In general, it pays to remember this simple maxim: “Undo is your friend.”<br />

F<strong>in</strong>d and Replace<br />

F<strong>in</strong>d and Replace are used fairly heavily <strong>in</strong> programm<strong>in</strong>g. F<strong>in</strong>d might be used to f<strong>in</strong>d a specific<br />

piece of code or a specific variable <strong>in</strong> your code. Replace might be used to change a variable’s<br />

name or to change the name of a function. The possibilities are endless.<br />

The <strong>C++</strong>Builder F<strong>in</strong>d and Replace dialog boxes implement more or less standard f<strong>in</strong>d-andreplace<br />

operations. To br<strong>in</strong>g up the F<strong>in</strong>d dialog box, choose Search | F<strong>in</strong>d from the ma<strong>in</strong>

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

Saved successfully!

Ooh no, something went wrong!