Juha Manninen schreef:
Hi,
I have learned more about Lazarus / FPC by porting some Delphi code. It seems
to be very usable now, I am impressed. I must admit I considered it as a
hopeless project some years ago when I first noticed it. Not any more...
:-)
But first a minor complaint. I often get errors like:
Error: Illegal type conversion: "ShortString" to "^Char"
or
Error: Call by var for arg no. 2 has to match exactly: Got "AnsiString"
expected "ShortString"
if I don't add
{$MODE DELPHI}
into a source file. However, I don't explicitly define any short strings. The
default objfpc mode illogically thinks a "string" as function parameter is
short string but other "string"s are dynamic ansistrings (or something like
that).
The language has evolved and short string is mostly a historical remain.
I would suggest that MODE DELPHI is made default in Lazarus or then FPC's MODE
OBJFPC is fixed.
It is unlikely that mode objfpc will be 'fixed', it will break a lot of
existing code. Therefore the default Lazarus settings are to add {$mode
objfpc}{$H+} to all new files to turn on string=ansistring.
Vincent
--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus