Chapter 5. Language Reference

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:

Directive

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.

Function

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.

Interface

A declaration of a standard interface.

Keyword

A keyword is a reserved identifier whose meaning is determined by the Delphi compiler. You cannot use the keyword as a variable, method, or type name.

Procedure

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.

Type

You know what a type is. Some types are built into the compiler, but many are defined explicitly in the System unit.

Variable

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset