Errors, bugs, questions - page 1784

 
Rashid Umarov:
Look here - Program run

For a summary of the programmes in MQL5, see the table below:

Program

Execution

Note

Script

In its own thread, as many scripts as there are execution threads for them

A looped script cannot interrupt the work of other programs

Expert

In its own thread, as many experts - as many execution threads for them

A looped expert cannot disrupt work of other programs

Indicator

One execution thread for all indicators on one symbol. As many indicator symbols - as many execution threads for them

Endless loop in one indicator will stop all other indicators on this symbol

Thanks, that's what I meant

Forum on trading, automated trading systems & strategy testing

Bugs, bugs, questions

Slawa, 2017.02.06 07:22

But here too, you can't bank on the fact that the Deinit command on M5 will be processed before the Init command on M15

 
-Aleks-:

Alas, I am not familiar with this format.

The experiment showed that the number in the graphical buffer is represented by the same rules as double - i.e. it is not possible to pass such a long number through the graphical buffer - frustrating.

Alas, the graphical buffer can only hold a number of 10 digits.

By the way, why is there a 4 decimal places limit?

 

Compilation error (or rather no error message)

class A {
public:
        int i;
};
class B : public A {};
class C : protected A {};
class D : protected B {};
void OnStart()
{
        C c;
        Print( c.i ); //Error: 'i' - protected member access error
        D d;
        Print( d.i ); //нормально???
}
 

Execution error: EX5 loading failed

class A;
typedef void (*f)( A*);
class A {
    virtual void g( A *a ) {}
        f ff;
};
void OnStart() { Print( __FUNCTION__ ); }
 

Error during execution

class B;
void f( B* );
class A { public:
        virtual ~A() { f((B *)&this ); } //(*)
        virtual void g( A* ) { Print( __FUNCTION__ ); }
};
class B : public A { public:
        virtual void g( A* ) { Print( __FUNCTION__ ); }
};
void f( B *b ) { b.g( b ); }
void OnStart() //(1)
{
        B *b = new B;
        delete b;
}

Result: incorrect casting of pointers in (*)

And if

void OnStart() { B b; } //(2)

result: B::g

but what is the fundamental difference between OnStart (1) and (2)?

Besides, the result of a similar code in C++: A::g

 

A100: 

What would a virtual destructor like the one in your example above be for? Can it be overridden in the descendant?

 
fxsaber:

What would a virtual destructor like the one in your example above be for? Can it be overridden in the descendant?

In MQL it is always virtual, even if not specified explicitly
 
A100:
In MQL it is always virtual, even if it is not explicitly stated
So you didn't answer the question - what for?
 
fxsaber:
So you haven't answered the question - what for?
If all destructors in MQL are virtual, then the question why do we need a virtual destructor comes down to what do we need a destructor for? And this is too general a question.
 
A100:
If all destructors in MQL are virtual, then the question of what a virtual destructor is for is reduced to the question of what a destructor is for? And this is too general a question.
I know what a destructor is used for. It's not clear to me why I should add the word virtual before its definition.
Reason: