External Directive
subroutine declaration
; external;subroutine declaration
; externalDllName
;subroutine declaration
; externalDllName
nameString
;subroutine declaration
; externalDllName
indexConstant
;
Every subroutine declared in a unit’s
interface
section must be implemented in the same
unit’s implementation
section. Subroutines
can be implemented with the external
directive,
which means the actual implementation is in a separate object file or
DLL. If no DllName
is given, the external
implementation must be linked from a compatible object file using the
$L
or $Link
compiler
directive.
A DllName
must be a string constant. For
maximum portability, be sure to include the .dll
extension in the DLL’s filename. (Windows NT, for example,
requires the file’s extension.) By default, Delphi looks up the
subroutine name in the DLL, but you can specify a different name to
look up or specify a numeric index.