I don't see an index option listed in the reference.
var
Free : pchar; external comctl32 index 73;
I assume comctrl32 is declared as a string constant?
You're right the "index" option does not appear in that definition but, it is a valid option (maybe a documentation bug should be filed ?). For instance, the following compiles:
function AddMRUData
(
{ _in_ } InListHandle : THANDLE;
{ _in_ const } InData : pointer;
{ _in_ } InDataSize : DWORD
)
: longint; stdcall; external comctl32 index 167; { ordinal only !! }
which imports comctl32's ordinal 167 using the name "AddMRUData" (which is the name it is given in comctl32's PDB symbols - in the PE file, it is unnamed)
Also, you are correct that the external name "comctl32" has been defined as a constant earlier in the unit.
@howardpc
I want to import unnamed variables that are exported by comctl32.dll - for a function, the compiler allows to specify the index of the unnamed function (as shown above) but, it doesn't seem to allow the same for an unnamed variable which is what's needed when the variable is exported by ordinal only.