Woody: So is the file in a wrong directory or something?
- Verify it's in the <DataDirectory>MQL4\files or <DataDirectory>\tester\files depending on live vs. tester.
Data Structure in MetaTrader 4 Build 600 and Higher - MQL4 Articles 17.02.2014 - Don't just check the return code capture the last error also.
What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles4100
ERR_SOME_FILE_ERROR
Some file error
4101
ERR_WRONG_FILE_NAME
Wrong file name
4102
ERR_TOO_MANY_OPENED_FILES
Too many opened files
4103
ERR_CANNOT_OPEN_FILE
Cannot open file
4104
ERR_INCOMPATIBLE_FILEACCESS
Incompatible access to a fil
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello,
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.
So is the file in a wrong directory or something?
Does anyone have an idea of whats wrong?
Thanks in advance
Woody