Errors, bugs, questions - page 1969

 
Alexey Kozitsyn:
Yeah i see... I'll create another application then.

My application for MT5 - 2016.10.11 16:28,#1584315- accepted for review so far. ;-)

 
Stanislav Korotky:

My application for MT5 - 2016.10.11 16:28,#1584315- accepted for review so far. ;-)

The BOD needs to write to the application periodically for them to respond to it. Sometimes they miss it.
 
Alexey Kozitsyn:
That's what I thought was fixed, but now it's not. Just checked. Bild 1643.

It's build 1650. Check it out.

 
Artyom Trishkin:

It's already build 1650. Check it out.

OK, I just named the latest official build.
 

Originally, there were several modules. Everything was working fine. Due to ... decided to temporarily convert everything into one.
Result: the program started working differently.
I found out the reason:

#ifndef _WIN64 //добавлено
class A {
public:
        A() { Print( a ); } //Результат: 0 //не может быть
        static const int a; //(1)
}; 
static A *a = new A;    //(2)
const int A::a = 1;     //(3)
void OnStart() {}
#endif

We were unable to find out exactly why this particular sequence of lines appeared (usually implementation/initialization comes right after declaration). Perhaps it was mutual crossing of classes.

I don't know how exactly the C++ compiler does it, but the Result: 1 (as expected)
 

Error, reading fails.

   ulong l[] = {ULONG_MAX};
   ulong l2[1];
   {
      int file = FileOpen("ttt", FILE_WRITE|FILE_BIN);
      FileWriteArray(file, l);
   }
   {
      int file = FileOpen("ttt", FILE_READ|FILE_BIN);
      FileReadArray(file, l2);
   }
   Alert(l[0] == l2[0]);
   Alert(l[0], "   ", l2[0]);
   return;

Alert:

false

18446744073709551615 10000000

Hex image of the number in the file: FF FF FF FF FF FF FF FF FF

 
pavlick_:

The error, the reading is malfunctioning.

Not reading, but array initialization. Remove curly brackets.

I'm slow, I'll double-check it.
 
Комбинатор:

Not reading, but initialising the array. Remove the curly braces.

Without them it won't compile at all ('l' - invalid array access). Anyway - the number in the file is correct.

 
I suspect the first handle should be closed or opened with the FILE_SHARE_READ flag
 
Комбинатор:
I suspect the first handle should be closed or opened with FILE_SHARE_READ flag

Thank you for your interest. I did. Closed the handles, now works properly. Got an error in my script, trying to localize it, so far.

Reason: