<div dir="ltr"><font face="monospace, monospace">program Test123;</font><div><font face="monospace, monospace">{$ifdef fpc}</font></div><div><font face="monospace, monospace"> {$mode delphi}</font></div><div><font face="monospace, monospace">{$endif}<br><br>type<br> TTest = record<br> public<br> a: LongInt;<br> b: LongInt;<br> end;<br><br> TTestHelper = record helper for TTest<br> public<br> const Default: TTest = (a: 1; b: 2);<br> end;<br><br>var <br> Test: TTest;<br>begin<br> Test := TTest.Default;<br>end.</font></div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Nov 10, 2018 at 10:06 AM Ryan Joseph <<a href="mailto:ryan@thealchemistguild.com">ryan@thealchemistguild.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Should’t this work? This would be a good way to set default record values but it doesn’t seem to be supported.<br>
<br>
<br>
type<br>
TMyRecord = record<br>
public<br>
a: integer;<br>
b: string;<br>
const<br>
default: TMyRecord = (a: 100; b: 'foo');<br>
end;<br>
<br>
var<br>
r: TMyRecord = TMyRecord.default;<br>
<br>
<br>
Regards,<br>
Ryan Joseph<br>
<br>
_______________________________________________<br>
fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank">fpc-pascal@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal" rel="noreferrer" target="_blank">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a></blockquote></div>