CSV File cannot be opened in notepad

 

Hi,

I would like to save in common folder 2 variables in order to use them in another EA.

here is my code :

 

if ((hautt!=haut) || (bast!=bas))

           { numfichier=FileOpen("points.csv",FILE_CSV|FILEWRITE|FILE_COMMON,';');

             FileWrite(numfichier,haut,bas);

             FileClose(numfichier);

             hautt=haut;bast=bas;}

 

When I want to open it with notepad to see if everything is ok, I have this message : attached file 

What's wrong ?

Regards, 

 
Have a read here, specifically about shared access. 
File Opening Flags - Input/Output Constants - Standard Constants, Enumerations and Structures - MQL4 Reference
File Opening Flags - Input/Output Constants - Standard Constants, Enumerations and Structures - MQL4 Reference
  • docs.mql4.com
File Opening Flags - Input/Output Constants - Standard Constants, Enumerations and Structures - MQL4 Reference
 
I thought that using FileClose could be enough to open the file after, with notepad.
 
Frédéric LEBRE:
I thought that using FileClose could be enough to open the file after, with notepad.
Do you have the same problem with (all the) terminals closed?
 

No problem with terminal closed. So what is the use of CloseFile ?

 
Frédéric LEBRE:

No problem with terminal closed. So what is the use of CloseFile ?

Is that code ending up in a loop? How are you calling it? 
 
Frédéric LEBRE:

No problem with terminal closed. So what is the use of CloseFile ?

Maybe the code is opening and closing the file so rapidly that when you try to open it with Notepad  it always seems to be open.

Have a read of what Honest Knave mentioned re shared access.