This is the big chapter—the language reference. Here you can
find every keyword, directive, function, procedure, variable, class,
method, and property that is part of Delphi Pascal. Most of these
items are declared in the System
unit, but some
are declared in SysInit
. Both units are
automatically included in every Delphi unit. Remember that Delphi
Pascal is not case sensitive, with the sole exception of the
Register
procedure (to ensure compatibility with
C++ Builder).
For your convenience, runtime error numbers in this chapter are
followed by exception class names. The SysUtils
unit maps the errors to exceptions. The exceptions are not part of
the Delphi language proper, but the SysUtils
unit
is used in almost every Delphi project, so the exceptions are more
familiar to Delphi programmers than the error numbers.
Each item falls into one of a number of categories, which are described in the following list:
A directive is an identifier that has special meaning to the compiler, but only in a specific context. Outside of that context, you are free to use directive names as ordinary identifiers. Delphi’s source editor tries to help you by showing directives in boldface when they are used in context and in plain text when used as ordinary identifiers. The editor is not always correct, though, because some of the language rules for directives are more complex than the simple editor can handle.
Not all functions are really functions; some are built into the compiler. The difference is not usually important because the built-in functions look and act like normal functions, but you cannot take the address of a built-in function. The descriptions in this chapter tell you which functions are built-in and which are ordinary.
As with
functions, some procedures are built into the compiler and are not
ordinary procedures, so you cannot take their addresses. Some
procedures (such as Exit
) behave as though they
were statements in the language, but they are not reserved keywords,
and you use them the same way you would use any other procedure.
Most of the
variables defined in the Delphi language are ordinary variables in
the System
or SysInit
units.
The difference between these units is that the variables in the
System
unit are shared by all packages loaded into
an application, but each package has its own copy of the
SysInit
unit. If you know what you are doing, you
can change their values. If you aren’t careful, though, you can
wreak havoc with Delphi. Other variables (Self
and
Result
) are built into the compiler, and have
special uses.