Autor Beitrag
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Mi 12.02.03 10:19 
Hallo,
wenn mein Memo1 modifiziert wird, also wenn der Benutzer was eingibt, soll das Memo1 automatisch auf C:\Datei.tmp gespeichert werden! Wie mach ich das?

DANKE
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Mi 12.02.03 10:24 
Hallo,

du musst einfach im OnChange ereignis des Memos deine Speicher Funktion aufrufen. Im einfachsten Falle sieht das so aus:
ausblenden Quelltext
1:
2:
3:
4:
procedure TForm1.Memo1Change(Sender: TObject);
begin
  Memo1.Lines.SaveToFile('C:\Datei.tmp');
end;


Ich würde dir aber von dieser Idee anrahten, denn wenn du einen Schnellen Tipper hast wird deine Platte warscheinlich ziemlich ins rotieren geraten, besonders wenn der Text länger ist.

Gruß
Klabautermann
Andreas L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Mi 12.02.03 10:27 
DANKE

Wie kann ich das in Verbindung mit den TIMER bekommen, dass alle 5 Minuten gespeichert wird!
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Mi 12.02.03 11:19 
Wie wärs wenn du einfach nen Timer setzt, den obigen Code in das Timer-Event reinschreibst, das Intervall auf 5*60000 setzt und abwartest, was passiert? 8)
Bisschen Fantasie bitte beim programmieren *g*.

Gruß