[ Pobierz całość w formacie PDF ]
.WARNINGDelphi doesn t always properly keep track of when to rebuild units based on other units you vemodified.This is particularly true for the cases (and there are many) in which user interventionconfuses the compiler logic.For example, renaming files, modifying source files outside theIDE, copying older source files or DCU files to disk, or having multiple copies of a unit sourcefile in your search path can break the compilation.Every time the compiler shows somestrange error message, the first thing you should try is the Build All command to resynchronizethe make feature with the current files on disk.The Compile command can be used only when you have loaded a project in the editor.Ifno project is active and you load a Pascal source file, you cannot compile it.However, if youload the source file as if it were a project, that will do the trick and you ll be able to compile thefile.To do this, simply select the Open Project toolbar button and load a PAS file.Now youcan check its syntax or compile it, building a DCU.Copyright ©2001 SYBEX, Inc., Alameda, CA www.sybex.com2874c01.qxd 7/2/01 2:40 PM Page 35Managing Projects 35I ve mentioned before that Delphi allows you to use run-time packages, which affect thedistribution of the program more than the compilation process.Delphi packages are dynamiclink libraries (DLLs) containing Delphi components.By using packages, you can make anexecutable file much smaller.However, the program won t run unless the proper dynamiclink libraries (such as vcl50.bpl, which is quite large) are available on the computer whereyou want to run the program.If you add the size of this dynamic library to that of the small executable file, the totalamount of disk space required by the apparently smaller program built with run-time pack-ages is much larger than the space required by the apparently bigger stand-alone executablefile.Of course, if you have multiple applications on a single system, you ll end up saving a lot,both in disk space and memory consumption at run time.The use of packages is often butnot always recommended.I ll discuss all the implications of packages in detail in Chapter 12.In both cases, Delphi executables are extremely fast to compile, and the speed of the result-ing application is comparable to that of a C or C++ program.Delphi compiled code runs atleast five times faster than the equivalent code in interpreted or semicompiled tools.Exploring a ProjectPast versions of Delphi included an Object Browser, which you could use when a project wascompiled to see a hierarchical structure of its classes and to look for its symbols and thesource-code lines where they are referenced.Delphi now includes a similar but enhancedtool, called Project Explorer.Like the Code Explorer, it is updated automatically as you type,without recompiling the project.The Project Explorer allows you to list Classes, Units, and Globals, and lets you choosewhether to look only for symbols defined within your project or for those from both yourproject and VCL.You can see an example with only project symbols in Figure 1.10.FI GURE 1.10:The Project ExplorerCopyright ©2001 SYBEX, Inc., Alameda, CA www.sybex.com2874c01.qxd 7/2/01 2:40 PM Page 3636 Chapter 1 " The Delphi 6 IDEYou can change the settings of this Explorer and those of the Code Explorer in theExplorer page of the Environment Options or by selecting the Properties command in theshortcut menu of the Project Explorer.Some of the Explorer categories you see in this win-dow are specific to the Project Explorer; others relate to both tools.Additional and External Delphi ToolsBesides the IDE, when you install Delphi you get other, external tools.Some of them, suchas the Database Desktop, the Package Collection Editor (PCE.exe), and the Image Editor(ImagEdit.exe), are available from Tools menu of the IDE.In addition, the Enterprise edi-tion has a link to the SQL Monitor (SqlMon.exe).Other tools that are not directly accessible from the IDE include many command-linetools you can find in the bin directory of Delphi.For example, there is a command-lineDelphi compiler (DCC.exe), a Borland resource compiler (BRC32.exe and BRCC32.exe), and anexecutable viewer (TDump.exe).Finally, some of the sample programs that ship with Delphi are actually useful tools thatyou can compile and keep at hand.I ll discuss some of these tools in the book, as needed.Here are a few of the useful and higher-level tools, mostly available in the \Delphi6\binfolder and in the Tools menu:Web App Debugger (WebAppDbg.exe) is the debugging Web server introduced in Delphi 6.It is used to keep track of the requests send to your applications and debug them
[ Pobierz całość w formacie PDF ]