Delphi in a Nutshell coverDelphi in a Nutshell

by Ray Lischner

Examples

[ Tempest Software | Delphi in a Nutshell | Table of Contents ]

Download (374KB) the example projects now. Run the setup program to copy all the source code examples to your hard drive. Then open Nutshell.bpg in Delphi and away you go. Build all the projects, peruse the source code, install the Nut50.bpl design-time package, or do all three.

Note that when you build the cltn50.bpl and nutshl50.bpl runtime packages, they are installed to your Windows system directory. All the .dcu files are compiled into the lib directory, and the programs are compiled into the bin directory.

Note that the downloaded source code might differ from some of the examples in the book. The printed examples are often simplified to highlight an important point, but the downloaded source code contains the full complexity of a working project.

The source code examples are described below:

Collections
Interface-based collection classes. These classes are not discussed in the book, but are needed for the VmtInfo project. The package options save the cltn50.bpl package in your Windows system directory.
CpuID
Show the CPU identification using the CPUID instruction. See the nutshl50\cpuid.pas file for an example of ASM programming in Delphi.
Font Name Wizard
Trivial IDE extension that causes the TFont.Name property editor to display font names using the respective fonts. Demonstration of writing a DLL in Delphi.
Mandelbrot
Draw the Mandelbrot set. This project computes the set in a background thread, leaving the foreground thread free for user interaction. Demonstration of multi-threaded programming.
Memory Manager
Example of how to replace Delphi's memory manager with your own. This manager detects the presence of memory leaks.
Nutshl50
Smaller examples, many of which are used in the other projects. This directory contains the nut50 designtime package and the nutshl50 runtime package.
Test
Test application for the Nutshl50 package. The page tabs are mostly self-explanatory.
Threaditor
Multi-threaded text editor. Demonstrates the use of threads to print in the background and to perform text searches in the background.
VmtInfo
Displays Runtime Type Information (RTTI), including undocumented fields in a class's virtual method table (VMT). Add your own types and classes to explore their RTTI, too.
[ Tempest Software | Delphi in a Nutshell | Table of Contents ]