Autor Beitrag
Delphi_Rainer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: Fr 06.11.09 16:13 
Hallo,

Habe seit kurzem Delphi2010. Nun möchte ich meine alten Projekte von Delphi7 auf Delphi 2010 übersetzen. Dabei bin ich auf folgendes Problem gestoßen.

Wenn ich in Delphi 7 die folgende Wandlung ausführe:

c:=chr($83)

erhalte ich für c= Latin f mit Hacken.

unter Delphi 2010 bekomme ich für c = ?. Das ist in der Ascii Tabelle 3F Hex.

Was mache ich falsch ?
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Fr 06.11.09 16:37 
Was für einen Typ hat c?

_________________
Markus Kinzler.
Delphi_Rainer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: Fr 06.11.09 16:44 
Hallo,

c ist vom Typ Char. Aber es ist egal ob man c =char ord c= Ansichar konfiguriert.

Wenn man c einer String oder Ansistring Variable zuweist so

str:=c;

steht in str ein "?".

Das war unter Delphi 7 nicht so.
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Fr 06.11.09 16:49 
Ich denke mal, dass dies an der Unicode Unterstützung liegt.
Gibt es sowas wie AnsiChar? Wenn ja, deklarier c mal so.

_________________
PROGRAMMER: A device for converting coffee into software.
Delphi_Rainer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: Fr 06.11.09 16:59 
Hallo!

Es ist egal ob Char oder Ansichar !!!!
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Fr 06.11.09 17:10 
Delphi >=D2009 beachtet die Codepages bei AnsiChar anders:

ausblenden Delphi-Quelltext
1:
str := #$83+#0;					

_________________
Markus Kinzler.
Delphi_Rainer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: Fr 06.11.09 17:30 
Hallo

VAR str :string;

str:=#$83; liefert mein gesuchtes Zeichen.
Warum liefert str:=chr($83) ein anderes Zeichen ?
Delphi_Rainer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: Fr 06.11.09 18:16 
Hallo !

I found it

c:=Ansichar(chr($83));