[fpc-pascal] optionally uses a unit

Dmitry Boyarintsev skalogryz.lists at gmail.com
Mon Nov 18 07:52:07 CET 2013


Looks horrible. I thought that's why class-helpers were introduced?
But I'd go with a function.

thanks,
Dmitry


On Mon, Nov 18, 2013 at 1:38 AM, Xiangrong Fang <xrfang at gmail.com> wrote:

> Hi All,
>
> Is it possible to optionally use a unit? e.g.
>
> unit myunit;
> uses {$ifexists persist.pas}persist,{$endif} Classes;
>
> type
>   TMyClass = class
>   public
>     {$ifexists persist.pas}
>     procedure SaveToStream(s: TStream);
>     {$endif}
>   end;
>
> Thanks,
> Xiangrong
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20131118/2ca2928a/attachment.html>


More information about the fpc-pascal mailing list