mt5-manager/docs/articles/part-04/publish/code/04_cpp.txt
15 lines
593 B
Text
//+------------------------------------------------------------------+
//| InstanceFolder: имя папки экземпляра терминала |
//+------------------------------------------------------------------+
string InstanceFolder()
{
string path = TerminalInfoString(TERMINAL_DATA_PATH);
StringReplace(path, "\\", "/");
int len = StringLen(path);
if(len > 0 && StringGetCharacter(path, len - 1) == '/')
path = StringSubstr(path, 0, len - 1);
int pos = FindLast(path, "/");
return (pos >= 0) ? StringSubstr(path, pos + 1) : path;
}