@nikolay_s
The code seems straightforward and should work. I have tried it with codes similar to you. Try this one: https://fxdreema.com/shared/K9SXQIxK
If in your case still not working, it might be the csv file problem. The csv file in above demo is created with path fxDreema\positionAllowed.csv in the File folder. I have tested with or without delimiter, space, line feed, ... and they are all working. By the way, how do you edit and save the file ? Have you debug and check file_handle has been valid ?
My code is simple:
string InpFileName="positionAllowed.csv" ;
string InpDirectoryName="fxDreema" ;
//--- reset the error value
ResetLastError();
//--- open the file for reading (if the file does not exist, the error will occur)
int file_handle=FileOpen(InpDirectoryName+"//"+InpFileName,FILE_READ|FILE_CSV|FILE_ANSI);
if(file_handle!=INVALID_HANDLE)
{
v::positionRead = (int)FileReadNumber(file_handle);
//--- close the file
FileClose(file_handle);
}
capture_001_31012026_002040.png