Einzelnen Beitrag anzeigen

kaju74

Registriert seit: 22. Okt 2003
185 Beiträge
 
#5

Re: Konstanten-Migration auf Delphi 2009 (#1#2#3...)

  Alt 19. Mär 2009, 11:52
Ahhhh...vielen Dank. Die Direktive kannte ich noch nicht. Hier mal eine Erklärung von Dr.Bob:

Zitat:

Character literals between #128 and #255 – the so-called high ASCII values – have a specific value depending on the ANSI code page. As a result, we should not use the #128..#255 character literals, but use the actual characters themselves which will end up as Unicode characters in the source code.

(*$HIGHCHARUNICODE OFF*)

With the HIGHCHARUNICODE set to OFF, we can define the high-ASCII values without them turning into Unicode characters.

(*$HIGHCHARUNICODE OFF*)
var
C: AnsiChar;
begin
C := #128;

Without turning HIGHCHARUNICODE OFF, we would get a warning that the #128 character, actually WideChar constant #$0080 (based on the current active code page), would have to be narrowed from WideChar to AnsiChar.
Gruß,
kaju
  Mit Zitat antworten Zitat