Link to home
Start Free TrialLog in
Avatar of retep
retep

asked on

Problem with saving to textfile

Why does my file end up in c:\documents instead of the folder of my program???

My procedure looks like this:

Procedure TForm1.SaveMyFile;
Var
F : TextFile;
Begin

   AssignFile(F,'myFile.txt');
   Rewrite(F);
   Try
      writeLn(F,'bla bla');
      .
      .
      .
   finally
     CloseFile(F);
   end;
end;

Hope you can help me :)
Retep
Avatar of geobul
geobul

Hi,
The reason is not in the procedure above. Maybe there is a value 'Start in: c:\documents' in the shortcut. Maybe you change current directory somewhere in the code before saving the file.

Regards, Geo
ASKER CERTIFIED SOLUTION
Avatar of lz
lz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of retep

ASKER

Thanks :)