Autor Beitrag
Atreyu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 137


Delphi 7 Enterprise
BeitragVerfasst: Mi 05.12.07 22:51 
Ich verwende ParamBlobToStr(lpData), um einen String von einer 2ten Instanz meines Programms an die erste zu geben.
Er liefert den string auch, aber der String wird bei jedem Leerzeichen darin "gewrapped", also in eine neue Zeile versetzt.

zB:

C:\Programme\Neuer
Ordner\Neues
Projekt\blabla
-
1.exe

Das soll jetzt alles in eine Zeile, denn so kann ich meinen String nicht verwenden.

Wie kann ich den richtig formatieren?

Ich habe schon nach Chr(13) (sollte Linefeed oder Carriagereturn sein) gesucht, aber das bringt irgendwie nix.

edit: Ich habe den String mal in eine Textfile geschrieben. Es ist tatsächlich charakteristisch für CarriageReturn+LineFeed, also wie bitte kriege ich das raus?
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mi 05.12.07 23:21 
Moin!

user profile iconAtreyu hat folgendes geschrieben:
Das soll jetzt alles in eine Zeile, denn so kann ich meinen String nicht verwenden.
Wie kann ich den richtig formatieren?
Mit welchen/m Zeichen ist denn nun getrennt, CR, CRLF oder was? :nixweiss: Wenn du keine Ahnung hast, lade die Datei mal als Anhang hoch.

Du kannst dann z.B. mit StringReplace die Zeichen ersetzen. :idea:

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Atreyu Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 137


Delphi 7 Enterprise
BeitragVerfasst: Mi 05.12.07 23:41 
Komischerweise funktioniert StringReplace nicht. Der ersetzt gar kein Zeichen davon!

Ich kann die Datei schlecht hochladen, die ist über 1000 Zeilen gross und mein non-Open-Source-Projekt


edit: Okay, Stringreplace hat funktioniert, sorry.


Zuletzt bearbeitet von Atreyu am Mi 05.12.07 23:52, insgesamt 1-mal bearbeitet
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mi 05.12.07 23:50 
user profile iconNarses hat folgendes geschrieben:
Mit welchen/m Zeichen ist denn nun getrennt, CR, CRLF oder was?

_________________
There are 10 types of people - those who understand binary and those who don´t.
Atreyu Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 137


Delphi 7 Enterprise
BeitragVerfasst: Mi 05.12.07 23:53 
Das war wohl CRLF, ich hab Chr(13)+Chr(10) durch ein leerzeichen ersetzt.
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Do 06.12.07 09:35 
user profile iconAtreyu hat folgendes geschrieben:
Chr(13)+Chr(10)
lässt sich in jedem Zusammenhang ersetzen durch #13#10 ;)
Button1.Caption := 'zeile1'#13#10'zeile2'; : da braucht man nicht mal + !

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Atreyu Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 137


Delphi 7 Enterprise
BeitragVerfasst: Do 06.12.07 12:38 
Naja, ich musste es aus einem String nehmen.

Das wäre dann vielleicht
StringReplace( stringname,#13#10,' ',[flags]);
gewesen. Und ob das funktioniert hätte, weiss ich nicht.

Bei einer regulären Caption oder so mach ich es auch mit den #'s..
Zorro
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76

Win 2000, Win XP Pro
Delphi 7 Architect
BeitragVerfasst: Do 13.12.07 01:13 
user profile iconAtreyu hat folgendes geschrieben:
Naja, ich musste es aus einem String nehmen.

Das wäre dann vielleicht
StringReplace( stringname,#13#10,' ',[flags]);
gewesen. Und ob das funktioniert hätte, weiss ich nicht.

Bei einer regulären Caption oder so mach ich es auch mit den #'s..


Captions sind auch Strings. Und wenn JayEff schrieb "in JEDEM Zusammenhang durch #.. ersetzbar" dann hat er damit Recht.

Greetz
Zorro
Dunkel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 682

Mac OS X Snow Leopard
Xcode 3.1
BeitragVerfasst: Do 13.12.07 06:18 
Hallo!

Versuch mal, die einzelnen Parameter in Anführungszeichen zu setzen.

_________________
Ich streite einsam mich mit dieser Oberflächenwelt
Gutes sei ein löblich Brot von dem ich zehre - bis zum Tod [Das Ich - Im Ich]