Where is the application's exe-file ?
When an external file is needed by your application (e.g. a txt-file, or an ini-file, or...) it's common practice to
put the extra file(s) in the directory that contains the application's exe-file.
var ExeDir: string; procedure TForm1.FormCreate(Sender: TObject); begin ExeDir := ExtractFilePath(ParamStr(0)); Memo1.Lines.LoadFromFile(ExeDir + 'testdata.txt'); // ... // and so on... end;
But this can give problems when you run your application in Delphi's IDE (Integrated Development Environment). Suppose
that the project's source code files and the file testdata.txt are located in C:\DelphiTest, then you
are likely to receive an error message as follows:
Database Tutorials FAQ Crash Course Delphi Tips Source Code Downloads Links