Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Save files to a specified folder

Avatar of Peter Kiers
Peter KiersFlag for Netherlands asked on
Delphi
3 Comments1 Solution392 ViewsLast Modified:
Hi,

I have this for saving the data of several listviews to file.

procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  SaveListViewToFile(lstvGlucose, 'Glucose.sav');
  SaveListViewToFile(lstvBolus, 'Bolus.sav');
  SaveListViewToFile(lstvFoodDB, 'FoodDB.sav');
  SaveListViewToFile(lstvOwnDB, 'OwnDB.sav');
end;
(*---------------------------------------------------*)
procedure TMainForm.FormCreate(Sender: TObject);
begin
  if FileExists('Glucose.sav') then LoadListViewToFile(lstvGlucose, 'Glucose.sav');
  if FileExists('Bolus.sav') then LoadListViewToFile(lstvBolus, 'Bolus.sav');
  if FileExists('FoodDB.sav') then LoadListViewToFile(lstvFoodDB, 'FoodDB.sav');
  if FileExists('OwnDB.sav') then LoadListViewToFile(lstvOwnDB, 'OwnDB.sav');
end;
(*---------------------------------------------------*)

These files (if not exists) will be created and save to the application-folder.
But now I have made a folder called Data in the application-folder and I
want the programm to save (or create the files) in the folder.
I quess I have to change the code. Can someone help me?

P.