Re: [fpc-pascal] Printing types in generics

2017-10-19 Thread Sven Barth via fpc-pascal
Am 19.10.2017 08:41 schrieb "Ryan Joseph" : > > > > > 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

Re: [fpc-pascal] Printing types in generics

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

Re: [fpc-pascal] Printing types in generics

2017-10-18 Thread Sven Barth via fpc-pascal
Am 19.10.2017 07:45 schrieb "Ryan Joseph" : > > How should you print types in generics for debugging? here’s an example of how I’m doing it now but it’s hacky (forced type casting pointers) and tkSString crashes like it is. There should be a better solution I think.

[fpc-pascal] Printing types in generics

2017-10-18 Thread Ryan Joseph
How should you print types in generics for debugging? here’s an example of how I’m doing it now but it’s hacky (forced type casting pointers) and tkSString crashes like it is. There should be a better solution I think. procedure TStaticArray.PrintValue (value: T); begin case typeKind of