I have a function in my application that needs to return an array. I have found in a couple of places how to do this by declaring the array type, e.g.
type
TStringArray = array of string;
And then declaring my function
function SomeFunction(SomeParam: Integer): TStringArray;
My problem is trying to set this up in a form that has both interface and implementation. How do I declare my type and have a function declaration with that type in the interface ?
The golden rule is that the
interfacesection of a unit describes the data types used by the unit, and the types, classes and functions (their signatures) that reside in the unit. This is what all other units see. Theimplementationsection contains the implementation of the classes and functions. This is not visible to other units. Other units need to care about the interface of the unit, the ‘contract’ signed by this unit and the external unit, not the ‘implementation details’ found in the implementation section.