Autor Beitrag
Cyberbob
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: So 03.11.02 15:09 
try
Memo1.Lines.LoadFromFile ('blabla.ini') ;
except
Memo1.Lines.SavetoFile ('blabla.ini')


Dieser Code funktioniert nicht! warum? Hab ihn eigentlich hier aus dem Forum gemopst und angepasst, also er soll versuchen zu laden und wenn die datei nicht vorhanden ist sie schreiben. Helft mir bite

Cyberb :oops: b


Zuletzt bearbeitet von Cyberbob am So 03.11.02 15:39, insgesamt 1-mal bearbeitet
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: So 03.11.02 15:35 
probier mal das:

ausblenden Quelltext
1:
2:
3:
4:
5:
try 
Memo1.Lines.LoadFromFile ('blabla.ini') ; 
except 
Memo1.Lines.SavetoFile ('blabla.ini') ;
end;


TRY...EXEPT muss immer von einem end; abgeschlossen werden !!

_________________
In the beginning was the word.
And the word was content-type: text/plain.
bis11
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1247
Erhaltene Danke: 2

Apple Mac OSX 10.11

BeitragVerfasst: So 03.11.02 15:40 
Hi,

1. Möglichkeit :
ausblenden Quelltext
1:
2:
3:
4:
IF NOT FileExists('blabla.ini') THEN
  Memo1.Lines.SaveToFile('blabla.ini')
ELSE
  Memo1.Lines.LoadFromFile('blabla.ini');


2. Möglichkeit :
ausblenden Quelltext
1:
2:
3:
4:
5:
try
  Memo1.Lines.LoadFromFile ('blabla.ini') ;
except
  Memo1.Lines.SavetoFile ('blabla.ini');
end;
Cyberbob Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: So 03.11.02 15:41 
jo, danke nun macht er das was ich will ;-)

DANKE

Cyberb :oops: b