[Lazarus] UTF8String and UTF8Delete

Sven Barth pascaldragon at googlemail.com
Fri Dec 11 19:21:15 CET 2015


On 11.12.2015 13:12, Mattias Gaertner wrote:
> On Fri, 11 Dec 2015 08:05:12 +0100
> Sven Barth <pascaldragon at googlemail.com> wrote:
>
>> [...]
>>> UTF8Delete(AnsiString(Pointer(s)),1,1);
>>
>> While the typecast itself would probably work I strongly advice against it
>> since you're relying on implementation details.
>
> True.
>
>> Also I doubt that you can do this for var parameters...
>
> FPC 3.0 eats it without a hint.

I just checked the generated code and it's the same for both with and 
without Pointer. The question is whether this is intended to work. If I 
were you I definitely wouldn't rely on that until this question is 
answered (and then you can probably use it without the Pointer typecast...)

Regards,
Sven





More information about the Lazarus mailing list