Errors, bugs, questions - page 86

 
Interesting:
I don't think so. Overloading of standard functions is better not directly, but by declaring them in classes...

"I don't think so" would seem to refer to whether such a feature will remain in the future,

because that is now a possibility.

Why in classes, why can't we make an inluder of all overloaded standard functions and stick it everywhere?

 
Urain:

Oh wonder, it turns out you can overload predefined functions.

or is it a bug ???


You can, but be careful not to be surprised later (when you forget about overloading). See example for Context Resolution Operation ( :: )
 
Rosh:
You can, but be careful not to be surprised later (when you forget about overloading). See example for Context Resolution Operation ( :: )

Thank you, I see. That way you can set the overload scope and not have to worry about its fate.

But in this case I think it's the inluder variant which will be useful, because it's quite handy to select a position by a previously defined id.


So Eva will evidently have no brains because they'll have to give them to mql experts - they can program all sorts of stuff here ... :о)

 
Urain:

Zy Eva will probably be left without brains because they'll have to give them to mql experts, or they'll program all sorts of stuff here ... :о)

 
I found the following thing, maybe it's not a mistake and is designed that way, trying to write a number of type double in a text object, this construction writes a string in the form of 0.00000000
ObjectSetString(0,"PIPSetEditBBdeviation",OBJPROP_TEXT,(string)BBdeviation);
Документация по MQL5: Основы языка / Типы данных / Вещественные типы (double, float)
Документация по MQL5: Основы языка / Типы данных / Вещественные типы (double, float)
  • www.mql5.com
Основы языка / Типы данных / Вещественные типы (double, float) - Документация по MQL5
 
DoubleToString is better at once, so as not to get caught up in the future
 
sergeev:

better DoubleToString at once, so that you don't get caught up in the future
this is understandable, we need to make this work properly as well. the inverse conversion works by the way
 

The compiler is "silent" when checking for equality

void OnStart()
  {
    datetime Time=0;  
    
    if(Time=0) //???????? 
     {
       
     }
        
  }
 
Kos:

The compiler is "silent" when checking for equality


So, first the assignment Time=0 is doneand then it is checked whether it is true or false. Why should he care?

 
Kos:

The compiler is "silent" when checking for equality


Standard error of many people, I myself sometimes get caught (comparison is implemented differently in different languages)...

void OnStart()
{
datetime Time=0;  
    
  if(Time==0)
  {
  //Так правильно       
  }
        
}
Reason: