| xHarbour Reference Documentation > Statement Reference |
![]() |
![]() |
![]() |
Declares the symbolic name of an external function or procedure for the linker.
EXTERNAL <name1> [,<nameN>]
The EXTERNAL statement declares a symbolic name of a function or procedure for the linker. This is usually required when there is no direct call of a function or procedure in PRG code, for example when a function is only called within a macro-expression using the macro-operator. By declaring the symbolic name of a function as EXTERNAL, the linker is forced to link the corresponding function to the executable file.
Note: It is common practice to use the EXTERNAL declaration within an #include file. This way it is assured that functions are available in all PRG files that may call them indirectly.
| See also: | #include, ANNOUNCE, REQUEST |
| Category: | Declaration , Statements |
// The example forces the linker to link three functions that are only
// called within a macro expression.
EXTERNAL Memoedit, Memoread, Memowrit
MEMVAR fileName
STATIC cEditor := "Memowrit(fileName,Memoedit(Memoread(fileName)))"
PROCEDURE Main( cFile )
fileName := cFile
&cEditor
RETURN
http://www.xHarbour.com