Autor Beitrag
stigge
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: Do 01.03.07 16:00 
So schnell sieht man sich wieder^^
Dieses Mal eine Frage zu den ASCII-Zeichen.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
var   s0: string;
      i: integer;
      stelle: integer = 0;
      verschlüsselt: string;
      gerade: char;


s0 := edit9.Text;
edit9.Clear;
i := Length (s0);
if i = 0 then
close else
begin
stelle := stelle + 1;
gerade := s0[stelle];
verschlüsselt := verschlüsselt+chr(gerade);  //Hier der Fehler!
label1.caption := verschlüsselt;
end;


Und die Fehlermeldung:

[Fehler] Unit2.pas(62): E2008 Inkompatible Typen

Warum sind die Typen nicht kompitabel?
Saubäär
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 376



BeitragVerfasst: Do 01.03.07 16:03 
Hi,

ausblenden Delphi-Quelltext
1:
 verschlüsselt := verschlüsselt + gerade;  // gerade ist doch schon Char!					
stigge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: Do 01.03.07 16:24 
Ich will aber, das er mir das ASCII-Zeichen ausgibt, z.B: #67, #98, usw.
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Do 01.03.07 16:26 
Dann musst Du statt chr ord nehmen.
stigge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: Do 01.03.07 16:28 
user profile iconjasocul hat folgendes geschrieben:
Dann musst Du statt chr ord nehmen.


Dann kann ich aber nur Zahlen umwandeln lassen!
Und wie geht es mit Buchstaben und Sonderzeichen?


Zuletzt bearbeitet von stigge am Do 01.03.07 16:28, insgesamt 1-mal bearbeitet
Calculon
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 676

Win XP Professional
Delphi 7 PE, Delphi 3 PRO
BeitragVerfasst: Do 01.03.07 16:28 
Guckst du hier:

www.delphibasics.co.uk/RTL.asp?Name=Ord

Gruß

Calculon
--
stigge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: Do 01.03.07 16:31 
user profile iconCalculon hat folgendes geschrieben:
Guckst du hier:

www.delphibasics.co.uk/RTL.asp?Name=Ord

Gruß

Calculon
--


Danke, jetzt klappt alles so wie es soll!