Microsoft
Software
Hardware
Network
Question : Check ik file exist
Dear experts,
I have this to load and save the 3 listviews to file.
procedure TMainForm.FormClose(Sender
: TObject; var Action: TCloseAction);
begin
SaveListViewToFile(lstvGlu
cose, 'Glucose.sav');
SaveListViewToFile(lstvBol
us, 'Bolus.sav');
SaveListViewToFile(lstvFoo
dDB, 'FoodDB.sav');
end;
(*------------------------
----------
----------
-------*)
procedure TMainForm.FormCreate(Sende
r: TObject);
begin
LoadListViewToFile(lstvGlu
cose, 'Glucose.sav');
LoadListViewToFile(lstvBol
us, 'Bolus.sav');
LoadListViewToFile(lstvFoo
dDB, 'FoodDB.sav');
end;
But when I start my application the first time the files doesn't exits yet.
so, I get 3 times a error message. How can I prevent this.
That the programm first look if the fileexist otherwist create it.
P
Answer : Check ik file exist
Founded solution is very creative, but by default the files will be saved in (or loaded from) applications folder therefore
ExtractFilePath(Applicatio
n.ExeName)
is unnecessary.
Random Solutions
Cancel AutoPlay in Windows (XP and after) with C++
javascrip string parsing question
looping array makes array not empty, even though reset applied at start of loop
VMWare Workstation & Virus?
eCommerce in .NET
Using hyperlink control within a sqldatasource datalist control to pass a querystring value coming from the sqldatasource
ISA Server PPTP Site-To-Site Link Not Working
Display subform data linked to multiple data on main form
Asp.Net: Help-I am passing a querystring to ShowImage.ashx of a Picture in ImageData1. It is being reconized as a is reconized as a 'System.Byte[]'
Cisco QOS - Policing