Errors, bugs, questions - page 2554

 
Alexey Navoykov:
It would be nice if FileGetInteger could return the full time of file creation/modification, i.e. as a long with an accuracy of 100 ns (as it exists in OS), rather than this second castration...

so there's not even a suitable type now. datetime is just seconds, and in mqldatetime seconds is also a minimum interval. (although you can just return long).

winapi doesn't work?

 
Hello, do free indicators appear in the "Market" section of MT4 and how do I install them on the chart? They don't appear in the list of indicators in the chart properties.
 

Can you please tell me why this code doesn't work? I'm trying to write a variable to a file when I click the button, but to no avail.

void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {

   if(id==CHARTEVENT_OBJECT_CLICK)
     {
      if(sparam=="checkbox")
        {
         int handle_write;
         handle_write=FileOpen("checkbox_color.txt",FILE_READ|FILE_WRITE|FILE_TXT,';');
         if(handle_write>0)
           {
            FileWrite(handle_write,"Green");
            FileClose(handle_write);
           }
        }
     }

  }

If I enable reading from file, everything works.

void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {

   if(id==CHARTEVENT_OBJECT_CLICK)
     {
      if(sparam=="checkbox")
        {
         int handle_read;
         handle_read=FileOpen("checkbox_color.txt",FILE_READ|FILE_WRITE|FILE_TXT,';');
         string checkbox_color=FileReadString(handle_read);
         Comment(checkbox_color);
        }
     }

  }
 
In the newer builds (after 2093), a bug has appeared in MetaEditor. When opening some files, the memory consumption starts to grow rapidly, leading to the process hanging up when all memory is consumed. Attempting to close this document also hangs. It has not yet been possible to localise the part of the code that causes the leak.
 
Why isn't the size of the message in the PM listed anywhere? I wrote an HOUR text to a person, didn't save it and it's all lost - I'm angry, frustrated.
 
Aleksey Vyazmikin:
Why is not specified anywhere the size of the message in the PM? I wrote HOUR a text to someone, didn't save it and it's all lost - I'm angry, frustrated.

I've been writing in notepad for a while now :).

And I do Ctrl+A and Ctrl+C before I press send.

I've already saved a lot of nerves this way...

 
Andrey Barinov:

I've been writing in notepad for a while now :).

And I do Ctrl+A and Ctrl+C before I press send.

I've already saved a lot of nerve...


It's in the blood Ctlr+A and Ctrl+C

 
Andrey Barinov:

I've been writing in notepad for a while now :).

And I do Ctrl+A and Ctrl+C before I press send.

I've already saved a lot of nerves this way...

It is high time the developers solve this problem and make it possible to insert code into messages, like on the forum.

 
Влад:

Can you please tell me why this code doesn't work? I'm trying to write a variable to a file when I click the button, but to no avail.

And if I enable reading from file, everything works.

Partially solved. It doesn't work if there is a record indicator in one window and a read indicator in the other one. If you remove the read indication from the file, everything is saved when you click. So the variable cannotbe written to a file from which it is reading at the same time.

Tried to use for writing:

handle_write=FileOpen("checkbox_color.txt",FILE_WRITE|FILE_TXT,';');

A for reading:

handle_read=FileOpen("checkbox_color.txt",FILE_READ|FILE_TXT,';');

No use...

 
Влад:

Partially solved. It doesn't work if there's a write in one window and a read in the other.

add FILE_SHARE_READ for write handle and FILE_SHARE_WRITE for read handle
Reason: