Autor Beitrag
colaka
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 200
Erhaltene Danke: 4

Win XP, W7
Delphi 2005 Prof.
BeitragVerfasst: Di 13.12.11 06:15 
Hallo,

ich habe ein DBMemo-Feld, in dem eigentlich nur Fließtext stehen soll. Aber manchmal schleichen sich beim Eingeben versehentlich Zeilenumbrüche ein, die man nicht erkennt, und die ich automatisch entfernen möchte. Dazu habe ich im OnExit-Ereignis des Memofeldes das folgende eingegeben:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TFVerwaltung.DBMemoArtIDExit(Sender: TObject);
begin
  DatMod.TArtID.Edit;
  StringReplace(DatMod.TArtIDLangtext.AsString, #10#13' ', [rfReplaceAll]);
  DatMod.TArtID.Post;
end;


Das läßt sich ohne Fehlermeldung ausführen, aber funktionieren tut es auch nicht.
Besonders ein Zeilenumbruch am Ende des Textes muß unbedingt entfernt werden, weil Google-Shopping solche Artikelbeschreibungen ablehnt.

Habt Ihr eine Idee?

Danke Ebi


Zuletzt bearbeitet von colaka am Di 13.12.11 07:19, insgesamt 1-mal bearbeitet
Andreas Schilling
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 128
Erhaltene Danke: 1

WIN XP, WIN 7
Delphi 5 Ent, Delphi 2007 Pro, XE4
BeitragVerfasst: Di 13.12.11 07:01 
Versuche es einmal mit #13#10

Gruß Andreas
colaka Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 200
Erhaltene Danke: 4

Win XP, W7
Delphi 2005 Prof.
BeitragVerfasst: Di 13.12.11 07:10 
Hallo Andreas,

vielen Dank, aber das funktioniert leider auch nicht.

Gruß Ebi
bummi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1248
Erhaltene Danke: 187

XP - Server 2008R2
D2 - Delphi XE
BeitragVerfasst: Di 13.12.11 07:15 
StringReplace ist eine Funktion, Du solltest die Rückgabe auch zuweisen.

_________________
Das Problem liegt üblicherweise zwischen den Ohren H₂♂
DRY DRY KISS

Für diesen Beitrag haben gedankt: colaka
baka0815
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 489
Erhaltene Danke: 14

Win 10, Win 8, Debian GNU/Linux
Delphi 10.1 Berlin, Java, C#
BeitragVerfasst: Di 13.12.11 09:54 
Es könnte auch sein, dass als Zeilenumbruch nur #10 oder nur #13 drin steht, ich würde die beiden Zeichen daher unabhängig voneinander ersetzen.