AnsiString must be supported?
I dont undertsand if AnsiString is compatible or dont with CrossVcl. I try a simple vcl form with a simple button:
procedure TForm2.Button1Click(Sender: TObject); var aString : AnsiString; begin aString := 'Holá'; Showmessage(aString); end;
[DCC Error] Unit2.pas(30): E2010 Incompatible types: 'Pointer' and 'string' [DCC Error] Unit2.pas(31): E2010 Incompatible types: 'string' and 'Pointer'
Comments (11)
-
repo owner -
reporter Eugene, In a delphi console app.
This:
var aString : AnsiString;
Compile ok for win32 compiler.
but Fail for linux compiler
[DCC Error] Project3.dpr(12): E2003 Undeclared identifier: 'AnsiString'
So, i understand you use the linux compiler on CrossVcl and then is not possible to support AnsiString. The problem is almost all the thirdy party developers and libraries stands on AnsiString. That is the response to your question on WHY to use AnsiStrings. I see a big problem comming here.
Or im wrong?
-
repo owner AnsiString is not main issue with third-party i guest. There are lot of issues with old-vcl components and new Delphi compiler. Unfortunately we can't resolve it.
-
repo owner The point that third-party vendors should think about it and make it's tools more flexible. And you can help with that.
-
repo owner In latest version AnsiString and AnsiChar types should work. We added aliases to Utf8String and Utf8Char.
-
reporter Great news! Im trying to test now but for some reason my project havent Linux platffotm and the add new platform menu is not there anymore. With new projects is there. Seems like some flag in the projects becomes crazy? How to clean the old project config to allow to add again the linux plattform?
-
repo owner Yes, right now new platform can be added only to just Windows VCL project. We are working on fixing it.
-
reporter Ok, i remove by hand osx references and works now. Will try and tell you later. Best regards
-
reporter Ok, now Ansistrings are recognized but seems like you must add the Winapi.Windows unit to the uses list. Not bideal at all, just to know, theres any global define i can use for crossvcl?
Some like
{$IFDEF CROSSVCL} Winapi.Windows
Let me know.
-
repo owner There is no way to declare project based directive. Add Winapi.Windows is one of better way to add support for missing features.
-
repo owner - changed status to resolved
- Log in to comment
AnsiString don't supported by Delphi compiler. There are also a lot of limitation - ARC, no ADM, no ShortString.
What purpose of using AnsiString ?
http://docwiki.embarcadero.com/RADStudio/Berlin/en/LLVM-based_Delphi_Compilers