The external modifier can be used to declare a function that resides in an external object file. It allows you to use the function in your code, and at linking time, you must link the object file containing the implementation of the function or procedure.
External directive
It replaces, in effect, the function or procedure code block. As such, it can be present only in an implementation block of a unit, or in a program.
As an example:
Remark The parameters in our declaration of the external function should match exactly the ones in the declaration in the object file.
If the external modifier is followed by a string constant:
Then this tells the compiler that the function resides in library
'lname'. The compiler will the automatically link this library to
your program.
You can also specify the name that the function has in the library:
This tells the compiler that the function resides in library 'lname',
but with name 'Fname'. The compiler will the automatically link this
library to your program, and use the correct name for the function.
Under WINDOWS and OS/2, you can also use the following form:
This tells the compiler that the function resides in library 'lname',
but with index Ind. The compiler will the automatically
link this library to your program, and use the correct index for the
function.