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.

390 Day 10<br />

5. What’s the m<strong>in</strong>imum amount of memory your computer should have before you<br />

turn on the option to cache pre-compiled headers?<br />

6. What is the significance of generat<strong>in</strong>g debug <strong>in</strong>formation for your application?<br />

7. If you do not specify an Output Directory <strong>in</strong> the Project Options, where will<br />

<strong>C++</strong>Builder create your .exe file?<br />

8. What is the keyboard shortcut for sav<strong>in</strong>g a file <strong>in</strong> the Code Editor?<br />

9. How do you set a bookmark <strong>in</strong> an editor w<strong>in</strong>dow? How many bookmarks are<br />

available?<br />

10. How do you set a file to read-only <strong>in</strong> the Code Editor?<br />

Exercises<br />

1. Create a new application. Display the Project Manager. Click the Add Unit button<br />

to add a new unit to the project. Navigate to the<br />

\CBuilder\Examples\Apps\Contacts directory and choose the file called<br />

Contacts.cpp. Click OK to add the file to the project.<br />

2. Remove the Contacts.cpp unit from the project <strong>in</strong> Exercise 1.<br />

3. Open the ScratchPad project. Change the ma<strong>in</strong> form to the AboutBox form. Close<br />

the Project Options dialog box and run the program. The About box will be<br />

displayed when the program starts. Close the About box to end the program and<br />

change the ma<strong>in</strong> form back to the ScratchPad form.<br />

4. Open the RichEdit application that is supplied with <strong>C++</strong>Builder. Go to the Project<br />

Options dialog box and confirm that the Optimization sett<strong>in</strong>g on the <strong>C++</strong> page is<br />

set to Optimize for Speed. Do a Build All to build the program. Check the size of<br />

the produced .exe. Go back to the Project Options dialog box and change the<br />

optimization to Optimize for Size. Aga<strong>in</strong> do a Build All. Check the f<strong>in</strong>al .exe size<br />

aga<strong>in</strong> to compare the difference. How much smaller or larger was the .exe when<br />

the compiler optimized for size?<br />

5. Open any source file <strong>in</strong> the Code Editor. Set four bookmarks at random locations<br />

<strong>in</strong> the source file. Jump from bookmark to bookmark and observe the effects <strong>in</strong> the<br />

Code Editor. When you are f<strong>in</strong>ished, clear all the bookmarks.<br />

6. Open the ScratchPad project (or any other project) and switch to the Code Editor.<br />

View the project’s ma<strong>in</strong> form source file. Choose Search | F<strong>in</strong>d from the ma<strong>in</strong><br />

menu. Type Click <strong>in</strong> the Text To F<strong>in</strong>d box and click OK to f<strong>in</strong>d the first occurrence<br />

of the word Click.<br />

7. Press F3 several times to repeat the search until the entire file has been searched.

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

Saved successfully!

Ooh no, something went wrong!