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
Exchange active sync
A script to return user information
collection type
Want to reallocate disk areas in LINUX
Multi-threading log4net error
Can't activate windows with acronis
CSV export from a database
In Symantec Backup Exec 2010, how can I take a look at a failed backup job to determine exactly what has backed up (so I can know the exact point where the backups fail)?
How to set up a backup from Window 7 PC to shared network folder?
Addressing a virtualized server