I am trying to create a textfile with MQL4. No sucess. It just doesn't work. A very simple script:
void OnStart() {
string terminal_data_path=TerminalInfoString(TERMINAL_DATA_PATH);
string filename=terminal_data_path+"\\MQL4\\Files\\"+"teste2.txt";
int filehandle = FileOpen(filename,FILE_WRITE|FILE_TXT);
FileWriteString(filehandle,"teste");
FileClose(filehandle);
}
This fires error 5002. OK, the file does not exist. I thinked that the script will create the file.
So, I decided to create an empity "teste2.txt" with notepad in the folder. The same error.
Can someone help me?
Thanks