This was a UK BUG
Masterclass held on 4th April, 2000 in Hammersmith, England.
This Masterclass looks under the hood of Delphi, digging down
into advanced topics. It runs from 10 am until 6pm, with the
10:00 a.m. Introduction
Prospecting For Gold In The Delphi Source
This section involves looking through some of the source
files for the RTL and VCL, looking for not so well known
things that can be very useful to Delphi programmers.
- Where is the source?
We look at where we can find Delphi's valuable source code
- What is in all these directories?
Here we explore the various directories to see how they
are organised, and to get an idea of what sorts of things
live in which directories.
- What is the point of it all?
Knowing of the existence of this source code can allow you
to compile it into your applications, so you can trace
through the VCL code and see how things work. The source
can be used as a massive educational resource, to enhance
your knowledge of how Delphi application operate. As the
saying goes: "Use the source, Luke"
- What can be learnt from all this code?
Here we start looking at what we can pick up from careful
perusal of the RTL and VCL source files.
- Novel debug tracing possibilities
- Memory consumption tracing
- Windows API error exception producer
- Useful utility routines
- Turning a component into a string
- ...and more besides
11:30-11:45 a.m. Break
The IDE has many shortcut keys that go unused. For example
- Keystroke macro recording
- Case toggling
- Bookmark support
- Columnar block marking
- ...and many more
There are numerous undocumented registry entries that can
make it more usable. For example.
- Automatic component palette scrolling
- WYSIWYG Font property editor
- Personal settings directory
There are a number of other facilities that can prove very
useful that are never used by the majority of Delphi
1:00-2:00 p.m. Lunch
Run-Time Type Information
RTTI exists in all Delphi applications, but is typically
only used by the VCL code and the Delphi IDE. This section
looks at what information RTTI includes and looks for
situations where it can simplify certain programming tasks.
- What is RTTI for?
What is its primary raîson díêtre?
- What does it look like?
Where can we find Pascal definitions of RTTI structures?
- How do we access it?
Are there dedicated routines for accessing RTTI?
- What can we do with it?
What programming tasks can be simplified using RTTI?
- Identifying the unit that defines a type
- Translating enumerated type values to strings
- Getting a list of all a componentís properties
- Generic property reading & writing
- Setting common properties from different ancestors
- Setting default property field values in a component
- Copying properties from one component to another
- Easy state saving, e.g. to the registry
4:00-4:15 p.m. Break
This section focuses on the Object Pascal language as used
by Delphi. Because of the flexibility of the language,
there are many cases where cumbersome statements can be
rewritten in a more concise and often more elegant way.
There are also a number of "dirty" tricks that can be used
to accomplish tricky tasks. For example:
- Using sets to simplify conditions
- Using case statements
when sets donít work
- Single assignments versus conditions and assignments
- Objects with no object references
This section will look at as many of these sorts of things
as we can squeeze in.
- Using the CPU window
- Accessor classes
- Nefarious typecasting
- Accessing private data fields