I am trying to retrieve a simple double value from a "data.txt" file in the following function.However the FileOpen() function always returns -1 (INVALID_HANDLE).
The "data.txt" only contains 1 value (i.e. 89.55) and is located at MQL4/Files.
file_handle = FileOpen("data.txt",FILE_READ|FILE_TXT);
val = FileReadDouble(file_handle);
So is the file in a wrong directory or something?Does anyone have an idea of whats wrong?
Thanks in advance
Make sure that you do not have the file open when running the code.
Otherwise you will need to use at least one of the SHARE flags
Some file error
Wrong file name
Too many opened files
Cannot open file
Incompatible access to a fil
To add comments, please log in or register