Re: Tiburón and FastCode



Dennis wrote:
Hi

Hello FastCoders, just a curiosity question, but what kind of concerns
do you have about FastCode routines working with the new VCL coming in
the next release of Delphi?

Nothing yet, but let us discuss what we have to do. Please correct me if I
am wrong.

Functions defined with AnsiString as string type will have no problems

TCharPosFunction = function(Chr : Char; const Str : AnsiString) : Integer;

but functions defined to take or return the type "string" will fail if they
do not support WideString.

TTrimFunction = function (const S: string) : string;

One solution is to test that string=AnsiString prior to calling the
function. Another is to redefine the function prototypes.

TTrimFunction = function (const S: AnsiString) : AnsiString;

IMHO This solution is the correct one.

Why was functions like Trim defined to take and return "string" in the first
place?

Best regards
Dennis Kjaer Christensen


>
As CodeGear's engineers said "Except user explicit use AnsiString/AnsiChar, string/Char will be mapped to UnicodeString/WideChar automatically."

If FastCode is only designed for ANSI world. It would be useless for Tiburon.

--
Best regards
Xu, Qian (stanleyxu)
http://stanleyxu2005.blogspot.com/
.



Relevant Pages

  • [SUMMARY] AnsiString (#185)
    ... It would seem that writing Transfire's desired `ANSIString` class is ... Robert relies on other libraries to provide the actual ANSI codes; ... def register_lib lib_path, &blk ... string objects in a couple of ways: ...
    (comp.lang.ruby)
  • Re: Ascii und Ansi tauschen - Codeproblem
    ... eine Syntax "CharToOem AnsiString, AnsiString" die als Parameter 2x die selbe Variable bemüht für logisch, progammtechnisch zunmindest, unsinnig finde]. ... Was immer 'CharToOem AnsiString' bis hierhin tut erscheint logisch: der Funktionalität CharToOem wird ein Quelltext übergeben. ... Public Function ASCIItoANSI(ByVal AsciiString As String) As String ...
    (microsoft.public.de.word.vba)
  • Re: Did Borland doing well in Q4? Listen to the Earning CC
    ... Changing an type does not necessarily affect the application code. ... Because a String is *very* different from any ordinal type. ... to "ANSIString" etc. ... Not long after Tiburon is released you might hope to get a Unicode ...
    (borland.public.delphi.non-technical)
  • Re: Fastcode AnsiStringReplace
    ... function AnsiStringReplace(const S, OldPattern, NewPattern: ... Flags: TReplaceFlags): AnsiString; ... TReplaceFlags): string; ...
    (borland.public.delphi.language.basm)
  • Re: Fastcode Memory Read Rules
    ... The two rules are for different string types ... How far beyond the end of the ansistring can allways safely be read and is garuanteed to not violate the general rule? ... I can't image that the allocator would waste more then maybe 8 bytes? ... hmz i only allign on 8 bytes in my own paging allocator, so this could run into problems with fastcode? ...
    (borland.public.delphi.language.basm)