On Sat, Apr 29, 2017 at 7:21 PM, Sven Barth via fpc-pascal
<fpc-pascal@lists.freepascal.org> wrote:
>> If I remember well, PChar and even String is different between these
>> modes, right? The compiler will convert strings between them or this
>> is not a problem? Even using LCL?
>
> The default string type depends on two different things, namely the mode and
> the H switch which is by default only set in the Delphi modes. H- means that
> "String" is "ShortString". H+ means that "String" is "AnsiString" as long as
> modeswitch UnicodeString is not set (which is for example the case if the
> mode is DelphiUnicode). However since the latter isn't really recommended
> yet anyway (since the RTL and especially its classes would still mainly use
> String=AnsiString) you shouldn't really run into problems there.
> The same is true for (P)Char: only if modeswitch UnicodeString is set, then
> it's an alias for (P)WideChar, otherwise it's an alias for (P)AnsiChar.
> At least the conversions between the string types are handled by the
> compiler, only PAnsiChar <=> PWideChar conversions you'd need to do
> yourself, but the compiler would complain there anyway.

Sven, thank you for this explanation.
Well, I will try.

About generics, I'm not using them (yet) so, I won't have problems.

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

Reply via email to