<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Nov 29, 2014 at 5:55 PM, silvioprog <span dir="ltr"><<a href="mailto:silvioprog@gmail.com" target="_blank">silvioprog@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><span class=""><div class="gmail_quote">On Sat, Nov 29, 2014 at 4:54 PM, Michael Van Canneyt <span dir="ltr"><<a href="mailto:michael@freepascal.org" target="_blank">michael@freepascal.org</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div>
On Sat, 29 Nov 2014, silvioprog wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
On Sat, Nov 29, 2014 at 2:04 PM, Sven Barth <<a href="mailto:pascaldragon@googlemail.com" target="_blank">pascaldragon@googlemail.com</a>> wrote:<br>
On 29.11.2014 16:54, silvioprog wrote:<br>
Hello,<br>
<br>
Today I compiled my FPC from trunk and saw the following possibility:<br>
<br>
<br>
This feature is available since February 2013 already, you just had to use {$modeswitch typehelpers}<br>
(I even announced that on fpc-devel, fpc-pascal and fpc-announce back then). What I committed<br>
yesterday was simply to allow them by default in mode Delphi as that mode is simply a collection of<br>
features supported by the current Delphi version (in so far they are already implemented in FPC). You<br>
still have to use the modeswitch in other modes and in all modes except the Delphi ones it's "type<br>
helper" instead of "record helper".<br>
<br>
Regards,<br>
Sven<br>
<br>
<br>
Awesome. I'll use type helper. =)<br>
<br>
Plans to implement the currently XE helpers? (TIntegerHelper, TStringHelper etc.)<br>
</blockquote>
<br></div></div>
Definitely, as soon as I find time.<br>
But initial patches welcome.<span><font color="#888888"><br>
<br>
Michael.</font></span></blockquote></div><div><br></div></span><div>Nice. To implement it we can need to enable the <span style="font-family:arial,sans-serif;font-size:13px">{$modeswitch typehelpers}. Can you enable it in SysUtils?</span></div></div></div></blockquote></div><div><br></div><div>Just testing:</div><div><br></div><div><div>unit sysutils;</div><div>interface</div><div><br></div><div>{$MODE objfpc}</div><div>{$MODESWITCH OUT}</div><div>{$MODESWITCH TYPEHELPERS} </div></div><div>...</div><div><br></div><div>sysutilh.inc</div><div>...</div><div><div> function GetModuleName(Module: HMODULE): string;</div><div><br></div><div>type</div><div> TGuidHelper = type helper for TGuid</div></div><div><div>// class function Create(const B: TBytes): TGUID; overload; static;</div><div>// class function Create(const S: string): TGUID; overload; static;</div><div>// class function Create(A: Integer; B: SmallInt; C: SmallInt; const D: TBytes): TGUID; overload; static;</div><div>// class function Create(A: Integer; B: SmallInt; C: SmallInt; D, E, F, G, H, I, J, K: Byte): TGUID; overload; static;</div><div>// class function Create(A: Cardinal; B: Word; C: Word; D, E, F, G, H, I, J, K: Byte): TGUID; overload; static;</div><div>// class function NewGuid: TGUID; static;</div><div>// function ToByteArray: TBytes;</div><div>// function ToString: string;</div></div><div> end;</div><div>...</div><div><br></div><div>sysutilh.inc(330,3) Error: Type "TGuid" cannot be extended by a type helper<br></div><div><br></div><div>I'll leave this task to you. =D</div><div><br></div>-- <br><div class="gmail_signature">Silvio Clécio<br>My public projects - <a href="http://github.com/silvioprog" target="_blank">github.com/silvioprog</a></div>
</div></div>