Hi All,
Have a full day today to try and get this now unworkable script re-written in MQL5. Grrrrr.
A simple FileOpen() procedure that has worked for years now returns a value of -1
The SourceFile and Executable are way down there in the hole AppData/.../Scripts and the .csv's are in AppData/.../Files
Returns "true"
returns "-1" Allll righty then.
If the file does not exist, FileOpen() does create it, but FileWrite() does not write the heading.
Any Ideas?
Which build are you using ?
About your code, what if the handle is =1 ?
Build 600
Current build is 610 (official), beta build is 614.
Can you try with it ?
Hi angevoyageur,
I downloaded build 610 with MetaEditor build 887, and copied - metaeditor.exe, the two mql compiler files, and terminal.exe into my existing 600 build and put the corresponding 600 build files into a folder named 600.
I then opened the terminal and compiled the little script.
void OnStart() { MessageBox(FileIsExist("MEURmd.csv")); }
returns "true" as before
void OnStart() { int handle; handle = FileOpen("MEURmd.csv",FILE_WRITE|FILE_CSV,','); if(handle > 1) { FileWrite(handle,"DATE","OPEN","HIGH","LOW","CLOSE","VOLUME"); // heading FileClose(handle); MessageBox("File Created"); } if(handle < 1) { MessageBox(handle); } }
Now returns no message and still creates the file with no heading.
OK one step back...now forward...?
YL
Got it...
handle now == 1. Changed comparison to (handle>0) and the file is created and written to.
I changed the comparison in the original full script to (handle>0) and that was the only change needed :D :D :D
YL
Got it...
handle now == 1. Changed comparison to (handle>0) and the file is created and written to.
I changed the comparison in the original full script to (handle>0) and that was the only change needed :D :D :D
YL
Yes this is why I asked you :
About your code, what if the handle is =1 ?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi All,
Have a full day today to try and get this now unworkable script re-written in MQL5. Grrrrr.
A simple FileOpen() procedure that has worked for years now returns a value of -1
The SourceFile and Executable are way down there in the hole AppData/.../Scripts and the .csv's are in AppData/.../Files
Returns "true"
returns "-1" Allll righty then.
If the file does not exist, FileOpen() does create it, but FileWrite() does not write the heading.
Any Ideas?