Errors, bugs, questions - page 1535

 

Please explain to a newcomer why there is a compilation error with the structure (I see with the class) where the alleged use of &

struct A
{
};

void F( A a) // 'A' - objects are passed by reference only
{
}
 

In the MQL4 documentation for the Bars predefined variable, the reference for the Bars function is not correct (see figure).


 
Maxim Khrolenko:
Administration: what is the type of _RandomSeed predefined variable? The page(MQL4 and MQL5) doesn't say anything about it. Please correct the help.

You can look at it this way

Alert(typename(_RandomSeed));

uint

 
Rorschach:

You can look at it this way

uint

Thank you.

It would be good to write about it in documentation, as it is written for other predefined variables. By the way, for _StopFlag it is written as bool type, but

Alert(typename(_StopFlag));

is int. We have to do something about it.

 
Maxim Khrolenko:

Thank you.

It would be good to write about it in documentation, as it is written for other predefined variables. By the way, for _StopFlag the bool type is written, and here

shows int. We have to do something about it.

It is here.

By the way, you may even look at the function.

Alert(typename(IsStopped()));
Документация по MQL5: Основы языка / Объектно-ориентированное программирование / Шаблоны функций
Документация по MQL5: Основы языка / Объектно-ориентированное программирование / Шаблоны функций
  • www.mql5.com
Основы языка / Объектно-ориентированное программирование / Шаблоны функций - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
comp:

Please explain to a newcomer why there is a compilation error with the structure (I see with the class) where the alleged use of &

Structures, arrays, objects are passed by & reference and nothing else.
 
Vladimir Pastushak:
Structures, arrays, and objects are passed by & reference and nothing else.
The assignment operator works for structures, just like it does for standard types. Why then can't it be passed without reference?
 
help guys. can't put this indicator on mt4
Files:
barrange.mq4  3 kb
 

I hesitate to ask ... Is it me who needs more sleep?


 
Artyom Trishkin:

I hesitate to ask ... Is it me who needs more sleep?


Use int.
Reason: