Autor Beitrag
Green
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 283

Windows XP Home
Delphi 6 Enterprise
BeitragVerfasst: Mi 10.05.06 14:33 
habe folgendes problem: für das IRC Protokoll (Socket) brauche ich das Steuerzeichen \r\n welches aber wenn ich es mit '' anführe nur als text angesehen wird und wenn ich es mit "" anführe kommt ein 'Illegal input Character' Fehler...

wie kann ich an einen string dieses Steuerzeichen jetzt anfügen?

mfG Green
Horschdware
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 744
Erhaltene Danke: 54

Win XP Pro, Win 7 Pro x64
Delphi 7, Delphi XE, C++ Builder 5, SAP R/3
BeitragVerfasst: Mi 10.05.06 14:37 
ausblenden Delphi-Quelltext
1:
MyString := String1 + chr(10)+chr(13)+ String2;					

Zum Beispiel

_________________
Delphi: XE - OS: Windows 7 Professional x64
Green Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 283

Windows XP Home
Delphi 6 Enterprise
BeitragVerfasst: Mi 10.05.06 14:40 
also steht chr(10) für "\r" und chr(13) für "\n" ?

oder wie?
Horschdware
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 744
Erhaltene Danke: 54

Win XP Pro, Win 7 Pro x64
Delphi 7, Delphi XE, C++ Builder 5, SAP R/3
BeitragVerfasst: Mi 10.05.06 15:00 
schau mal in der ascii tabelle nach:
\n ist ein line feed, ascii code 10 (0x0A)
\r ist der carriage return, ascii code 13 (0x0D)

chr(X) erwartet als eingabe ein byte und gibt den entsprechenden character zurück.

_________________
Delphi: XE - OS: Windows 7 Professional x64
Stefan.Buchholtz
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 612

WIN 2000, WIN XP, Mac OS X
D7 Enterprise, XCode, Eclipse, Ruby On Rails
BeitragVerfasst: Mi 10.05.06 15:09 
Das ist falschrum, Chr(13) kommt zuerst.
Eine kürzere Schreibweise bei Char-Konstanten ist mit #:

ausblenden Delphi-Quelltext
1:
MyString := String1 + #13#10 + String2;					


Stefan

_________________
Ein Computer ohne Windows ist wie eine Schokoladentorte ohne Senf.
Horschdware
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 744
Erhaltene Danke: 54

Win XP Pro, Win 7 Pro x64
Delphi 7, Delphi XE, C++ Builder 5, SAP R/3
BeitragVerfasst: Mi 10.05.06 15:35 
Ups, sorry, mein Fehler mit dem Verdrehen

_________________
Delphi: XE - OS: Windows 7 Professional x64
Green Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 283

Windows XP Home
Delphi 6 Enterprise
BeitragVerfasst: Mi 10.05.06 18:45 
interessanter weise geht es auch andersrum ... naja danke für die hilfe!