Name
Index Directive
Syntax
functionGetter(Index: Integer):Property type; procedureSetter(Index: Integer; Value:Property type); propertyName:Property typeindexConstantreadGetterwriteSetter; functionArrayGet(Index: Integer; ArrayIndex:Index type):Prop. type; procedure ArraySet(Index: Integer; ArrayIndex:Index type; Value:Property type); propertyName[ArrayIndex:Index type]:Property typeindexConstantreadGetterwriteSetter; exportsSubroutineindexConstant;Subroutine header; externalDllNameindexConstant;
Description
The index directive has three distinct uses: declaring indexed properties, exporting subroutines, and importing subroutines.
Multiple properties can reuse a getter or setter method by specifying an
indexdirective and a unique index value. The index value is passed as the first argument to the getter and setter methods. See thepropertykeyword for more information.A unit or library can export subroutines with the
exportsdeclaration. Every exported subroutine has a unique index. If you do not supply anindexdirective, Delphi automatically assigns a unique index. See theexportskeyword for more information.A subroutine declaration can use the
externaldirective to import a subroutine from a DLL. By default, Delphi looks up the subroutine by name. If you supply anindexdirective, Delphi looks up the subroutine by index number, which is slightly faster (but subject to the possibility that the index number will change in a future revision of the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access