Answer the question
In order to leave comments, you need to log in
Running files that are in different folders "below the program itself"?
Good day to all, people need your help ... I
created a program,
please tell me the tag for the buttons for attaching the "exe" file to each button ...
and another question, as far as I understand the file for "exe" will be written in full, and you can somehow replace it, because the program itself with the necessary files will travel around the computer ... and so that the address is not rewritten every time, can this be specified from the directory?
Answer the question
In order to leave comments, you need to log in
And on a relative path it is impossible to start?
Type: "\core_x32\file.exe".
Use configuration files. In uses - IniFiles.
File example:
[Database]
user_name=SYSDBA
password=masterkey
locale=win1251
location=C:\DB.fdb
procedure TDMDatabase.DataModuleCreate(Sender: TObject);
var
ini : TIniFile;
login : String;
pass : String;
location : String;
locale : String;
begin
ini := TIniFile.Create(ExtractFilePath(Application.ExeName) + 'config.ini');
try
login := ini.ReadString('Database', 'username', 'SYSDBA');
pass := ini.ReadString('Database', 'password', 'masterkey');
location := ini.ReadString('Database', 'location', 'localhost:' + ExtractFilePath(Application.ExeName) + '\DB.fdb');
locale := ini.ReadString('Database', 'locale', 'WIN1251');
finally
ini.Free;
end;
//Используем полученные переменные
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question