[fpc-pascal] Check In Interface Type Helpers

Sven Barth pascaldragon at googlemail.com
Wed Aug 23 19:51:15 CEST 2017


Am 23.08.2017 16:01 schrieb "Anthony Walter" <sysrpl at gmail.com>:
>
> As to what they are useful for, consider the following:
>
> type
>   // IShellLink is define by Microsoft
>   IShellLinkHelper = record helper for IShellLink
>   public
>     procedure Save(const Target, Description, Link: string);
>   end;
>
> procedure IShellLinkHelper.Save(const Target, Description, Link: string);
> var
>   P: IPersistsFile;
> begin
>   SetPath(Target);
>   SetDescription(Description);
>   if Self is IPersistsFile then
>   begin
>     P := Self as IPersistsFile;
>     P.Save(Link, True);
>   end;
> end;
>

And I just noticed: it's "type helper" if you want to extend an interface,
not "record helper" ;)

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20170823/1306eb7f/attachment.html>


More information about the fpc-pascal mailing list