<div dir="ltr">Looks horrible. I thought that's why class-helpers were introduced?<div>But I'd go with a function.<br></div><div><br></div><div>thanks,</div><div>Dmitry</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Nov 18, 2013 at 1:38 AM, Xiangrong Fang <span dir="ltr"><<a href="mailto:xrfang@gmail.com" target="_blank">xrfang@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace">Hi All,</div><div class="gmail_default" style="font-family:courier new,monospace"><br></div><div class="gmail_default" style="font-family:courier new,monospace">
Is it possible to optionally use a unit? e.g.</div><div class="gmail_default" style="font-family:courier new,monospace"><br></div><div class="gmail_default" style="font-family:courier new,monospace">unit myunit;</div><div class="gmail_default" style="font-family:courier new,monospace">
uses {$ifexists persist.pas}persist,{$endif} Classes;</div><div class="gmail_default" style="font-family:courier new,monospace"><br></div><div class="gmail_default" style="font-family:courier new,monospace">type</div><div class="gmail_default" style="font-family:courier new,monospace">
TMyClass = class</div><div class="gmail_default" style="font-family:courier new,monospace"> public</div><div class="gmail_default" style="font-family:courier new,monospace"> {$ifexists persist.pas}</div><div class="gmail_default" style="font-family:courier new,monospace">
procedure SaveToStream(s: TStream);</div><div class="gmail_default" style="font-family:courier new,monospace"> {$endif}</div><div class="gmail_default" style="font-family:courier new,monospace"> end;</div><div class="gmail_default" style="font-family:courier new,monospace">
<br></div><div class="gmail_default" style="font-family:courier new,monospace">Thanks,</div><div class="gmail_default" style="font-family:courier new,monospace">Xiangrong</div></div>
<br>_______________________________________________<br>
fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a><br></blockquote></div><br></div>