The platform hinting directive on a symbol or unit indicates that it may not exist or that the implementation may vary
considerably on different platforms. The library hinting directive on a symbol or unit indicates that the code may not
exist or the implementation may vary considerably on different library architectures.
The platform and library directives do not specify which platform or library. If your goal is writing platform-independent
code, you do not need to know which platform
a symbol is specific to; it is sufficient that the symbol be marked as
specific to
some platform to let you know it may cause problems for your goal of portability.
In the case of a procedure or function declaration, the hint directive should be separated
from the rest of the
declaration with a semicolon. Examples:
procedure SomeOldRoutine; stdcall deprecated;
var
VersionNumber:
Real library;
type
AppError = class(Exception)
...
end platform;
When source
code is compiled in the
{$HINTS ON}
{$WARNINGS ON}
state, each reference to an identifier
declared with one of these directives generates an appropriate hint or warning. Use platform to mark items that are
specific to a particular operating environment (such as Windows or .NET), deprecated to indicate that an item is
obsolete or supported only
for backward compatibility, and library to flag dependencies on a particular library or
component framework.
The Delphi 2005 compiler also recognizes the hinting directive experimental. You can use this directive to designate
units which are in an unstable, development state. The compiler will emit a warning when
it builds an application
that uses the unit.
Statements
Statements define algorithmic actions within a program. Simple statements like assignments and procedure calls
can combine to form loops,
conditional statements, and other structured statements.
Multiple statements within a block, and in the initialization or finalization section of a unit,
are separated by
semicolons.
Dostları ilə paylaş: