Syntax example
The syntax entries for the EXTERN statement illustrate all of the syntax symbols:
EXTERN [ CDECL | PASCAL | STDCALL ] <return type> <function name>
([<parameter type> [, <parameter type> ... ]])
<filename>
The square brackets enclosing the calling convention, [ CDECL | PASCAL | STDCALL ], means the item is optional. The pipe character between the three calling conventions is an "or" indicator. In other words, if you want to use a calling convention, you must choose one of the three.
<return type> and <function name> are both required arguments.
The parentheses are fixed language elements, and thus also required. Inside the parentheses are optional <parameter type> arguments, as indicated by the square brackets.
The location of the comma inside the second square bracket indicates that the comma is needed only if more than one <parameter type> is specified.
The ellipsis (...) at the end means that any number of parameter type arguments may be specified (with a comma delimiter, if more than one is used).
<filename> is a required argument.
A simple EXTERN statement with neither of the two optional elements would look like this:
extern CINT angelsOnAPin( ) ANSWER.DLL
The <return type> argument is CINT, and the <function name> is angelsOnAPin.
A more complicated EXTERN statement with a calling convention and parameters would look like this:
extern PASCAL CLONG wordCount( CPTR, CLOGICAL ) ANSWER.DLL