Am 19.10.2017 08:41 schrieb "Ryan Joseph" <r...@thealchemistguild.com>:
>
>
>
> > On Oct 19, 2017, at 12:58 PM, Sven Barth via fpc-pascal <
fpc-pascal@lists.freepascal.org> wrote:
> >
> > And your case for tkSString crashes, because that is a ShortString, not
a AnsiString thus you need to cast to PShortString (best avoid "(P)String"
in this context as this could lead to different results depending on the
modeswitches). For the other string types you need to look at tkAString
(AnsiString), tkWString (WideString) and tkUString (UnicodeString).
> >
>
> I know why it crashes at least. Thanks.

You're welcome. :)

> Btw why can’t type helpers be used here? I though you could add those and
just call .Show() or something but I couldn’t figure that out.

You'd need a type helper for every type that you might specialize with and
all those would need to be in scope during the declaration (not
specialization!) of your generic as otherwise they wouldn't be found during
specialization.

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to