Autor Beitrag
lemi4ever
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Fr 14.05.04 20:07 
Also ich habe eine Text Datei welche ich in eine Memo Feld eingelesen habe.
Wenn ich die Text Datei z.B. über Windows Editor anschauen ist der Text sauber formatiert.
Wenn ich nun den Text über mein Memo einlese ist die Formatierung nicht mehr richtig

Beispiel:

Montag 1 10
Dienstag 2 15
Mittwoch 3 20
Donnerstag 6 12


Im Memo

Montag 1 10
Dienstag 2 15
Mittwoch 3 20
Donnertag 6 12

Kann ich das ändern ? Wenn ja wie

Der Code

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm1.FormCreate (Sender: TObject);
var s:String;
    l:TStringList;
begin
    l :=TStringList.Create;
    l.LoadFormFile ('Report.txt');
    s:=l.Text;
    Memo1.Text:= s;
end;


Gruss
Michael

Moderiert von user profile iconPeter Lustig (21:34, 14.05.2004): Delphi-Tags hinzugefügt
bms
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 735

Win XP
Delphi 3, Delphi 6 PE, Delphi 2005 PE
BeitragVerfasst: Fr 14.05.04 20:25 
ausblenden Delphi-Quelltext
1:
  Memo1.WantTabs := True;					

_________________
VORSICHT: Ich behersche seit heute die Fünf-Finger-Handflächen-Herz-Explodier-Schlag-Kampf-Technik >:(
lemi4ever Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Fr 14.05.04 20:53 
Titel: Keine Tabs sondern Leerschläge
Ich habe es versucht doch das war es nicht. So wie es aussieht sind das keine Tabulatoren in Text File welches ich einlese. Nur Leerschläge

Im Visual Basic konnte ich das Ganze mit

Wrap$ = Chr$(13) + Chr$(10)
txtEditor.Text = txtEditor.Text & strLine & Wrap$

lösen nun habe ich auf Delphi umgestellt.
bms
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 735

Win XP
Delphi 3, Delphi 6 PE, Delphi 2005 PE
BeitragVerfasst: Fr 14.05.04 21:05 
ausblenden Quelltext
1:
2:
Wrap$ = Chr$(13) + Chr$(10) 
txtEditor.Text = txtEditor.Text & strLine & Wrap$


ausblenden Delphi-Quelltext
1:
2:
Wrap := #13#10; 
txtEditor.Lines.Text := txtEditor.Lines.Text + strLine + Wrap;

_________________
VORSICHT: Ich behersche seit heute die Fünf-Finger-Handflächen-Herz-Explodier-Schlag-Kampf-Technik >:(