Errors, bugs, questions - page 1814

 
Alexey Kozitsyn:

Error in determining the type of ENUM_DATATYPE indicator parameters.

We can see that TYPE_COLOR(#6) shows TYPE_UINT instead of TYPE_DATETIME (#9), TYPE_LONG instead of TYPE_FLOAT(#12), TYPE_DOUBLE instead of TYPE. Although TYPE_COLOR, TYPE_DATETIME and TYPE_FLOAT types are described in the enumeration and should have their own values!

You can see the logic in the result, however. Even float->double can be explained. I would truncate the number of output types even more. In this sense, the ENUM_DATATYPE seems overly broad.

Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Идентификаторы типов данных
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Идентификаторы типов данных
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы индикаторов / Идентификаторы типов данных - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
fxsaber:

The logic in the result is visible, however. Even float->double is explainable. I would truncate the number of output types even more. In this sense ENUM_DATATYPE seems overly broad.

I see no logic in explicitly describing the ENUM_DATATYPE enumerator in the documentation and each member having its own number. I also don't see any logic in looking at the size in bytes of float and double types.
 
Alexey Kozitsyn:
I don't see the logic when the documentation explicitly describes ENUM_DATATYPE enumerator and each member has its own number. I also don't see logic in looking at the size in bytes of float and double types.
Well I would leave only integer (int) and "real" (double) types - from numbers.
 
fxsaber:
Well, I would only leave the int and double types - of numbers.
The simplest example: according to your logic, a variable type is int. You create a variable of this type. You want to write value = 2 there. But actually the type was bool. What to do then?
 
Alexey Kozitsyn:
The simplest example: You have obtained a variable of the int type by your logic. You create a variable of this type. You want to write value = 2 there. But the value is actually bool. What to do then?
void f( bool ) {}

void OnStart()
{
  f(2);
}
 
fxsaber:
void f( bool ) {}

void OnStart()
{
  f(2);
}
Fine, but you'll be operating with a value of 1. There will be a lot of hard-to-find errors.
 
Alexey Kozitsyn:
Fine, but you'll be operating with a value of 1. There will be a lot of hard-to-find errors.
There won't be any mistakes. You can't even make them up.
 
fxsaber:
There won't be any mistakes. You can't even make them up.
Just because you can't do something doesn't mean it can't be. Let's wait for the SR's answer.
 
Alexey Kozitsyn:
Just because you can't do something doesn't mean it can't be. Let's wait for the SD's answer.
The developers have their own view. You just can't really come up with an erroneous situation in int&double variant.
 
Deinitialisation error! Application#1677278!