SIR I HAD WRITTEN AN CODE FOR FILE WRITE BUT IT IS NOT WORKING, i did not know the what is the problem in this code , PLEASE CORRECT THE CODE
- DON'T SHOUT AT US. That is rude.
Play videoPlease edit your post.
For large amounts of code, attach it.
string fileName = "C:/abc.txt" ; int fileHandle = FileOpen(fileName,FILE_TXT|FILE_SHARE_READ|FILE_SHARE_WRITE);
Drop the "C:/" Files are only written to the sandbox (C:\Users\<USER>\AppData\Roaming\MetaQuotes\Terminal\<HEXSTRING>\MQL4\Files\abc.txt)
Data Structure in MetaTrader 4 Build 600 and Higher - MQL4 Articles 17.02.2014- You open the TXT file but don't state whether you are reading or writing it.
- Check your return codes Check your return codes and find out why. What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
- If you want a CSV file don't specify TXT
- If you had used this you would have found examples of append.
- If you had RTFM you would have found examples of write
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
DEAR SIR,
THIS IS MY CODE,
This code is not working
int start()
{
fifteen_minutescall();
return (0);
}
int fifteen_minutescall()
{
string fileName = "C:/abc.txt" ;
int fileHandle = FileOpen(fileName,FILE_TXT|FILE_SHARE_READ|FILE_SHARE_WRITE);
Alert("Added!");
FileWrite(fileHandle,"this is for test only ");
FileClose(fileHandle);
return(0);
}
the above code is not working, I request you that please correct the above code, and provide me an solution.
please give me an simple example for reading an text for csv file ( with full example ) or give me an link with an example ( since i am dam new coder, guide me an example which will be easy to understand )
thank you sir