[fpc-pascal] Printing types in generics

Ryan Joseph ryan at thealchemistguild.com
Thu Oct 19 08:09:45 CEST 2017

> On Oct 19, 2017, at 12:58 PM, Sven Barth via fpc-pascal <fpc-pascal at 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.

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.

	Ryan Joseph

More information about the fpc-pascal mailing list