How to give up absolute paths?

0 like 0 dislike
38 views
Hello, dear.
Write a program to test for knowledge of "something there".
And here have files, of which are a complete answer to the question format .txt
Indicate to them an absolute path.
How to find the necessary file without using absolute path?
by | 38 views

2 Answers

0 like 0 dislike
// Create the property in the form private AppPath: string; // when creating a calculated it procedure TfmMain.FormCreate(Sender: TObject); begin AppPath := ExtractFilePath(Application.ExeName); //... // then use DBName := AppPath + '\\' + 'base.sqlite';
by
0 like 0 dislike
Use a relative path.
Or use a variable/config with something like $MY_APP_HOME, which points to the folder with your program. Set once at installation and then something like $MY_APP_HOME/answers/*.txt
by

Related questions

0 like 0 dislike
3 answers
0 like 0 dislike
4 answers
asked May 4, 2019 by McMike
0 like 0 dislike
3 answers
0 like 0 dislike
2 answers
asked Sep 10, 2019 by DJZLO
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
33,568 users