Wishes for MT5 - page 72

 
stringo:

We have already discussed this. We found out that we can make do with the existing functionality.

Really? And what functionality can be dispensed with, please remind me?
 
Why are global variables only of type double? And in 4, it was a terrible hindrance, and in 5, it is not clear why not, in particular string variables.
Документация по MQL5: Основы языка / Переменные / Глобальные переменные
Документация по MQL5: Основы языка / Переменные / Глобальные переменные
  • www.mql5.com
Основы языка / Переменные / Глобальные переменные - Документация по MQL5
 

TheXpert:
Да ладно? И каким же функционалом можно обойтись, напомните, пожалуйста?

I told you. Available.

For example, we have the header files included once. No need for #ifdef.

Instead of macrosubstitutions of constants depending on a condition, we can use variables which are initialized differently in different conditions.

Again, the conditions can be defined by constant variables instead of defines by default.

Presence of the constant IS_DEBUG_MODE

Ability to determine on the fly in which environment the program operates (testing, debugging, visual testing, optimization, allowing to use dll).

 
marketeer:
Why are global variables only of type double? Both in 4 interfered terribly and in 5 it's not clear why not, in particular string variables.

This is the maximum size of the numeric data. You can put as much as 8 bytes of information in a global variable, which you can interpret as long, as 2 ints or as 64 bits.

Why global variables cannot be of type string, for the same reason that global variables cannot be arrays - not to complicate unnecessarily

 
stringo:

Why global variables cannot be of type string, for the same reason that global variables cannot be arrays - not to complicate things unnecessarily

Slava, the public will hardly agree with you in this case - this complication would not be unnecessary. Do you want to take a vote?
 
MetaDriver:
Slava, the public would hardly agree with you in this case - this complication would not be unnecessary. Do you want to take a vote?

"Overcomplicate" in this context means adding new slow functionality for a small number of users. A very efficient storage and access mechanism has now been implemented, and we do not want to destroy it.

To exchange data between programs (and even between client terminals on the same computer) you can use files. It is enough to write a couple of standard classes once.

By the way, about string global variables. You need them for string data exchange between programs within one client terminal? So why not pass the strings directly, via user events? It's much more efficient method than data exchange via global variables.

 
stringo:

This is the maximum size of the numeric data. You can put as much as 8 bytes of information in a global variable, which you can interpret as long, as 2 ints or as 64 bits.

Why global variables can't be string, for the same reason that global variables can't be arrays - so as not to complicate things unnecessarily

You know the familiar reasoning: you make life easier for yourself and harder for users, although the program seems to be written for their length. There is no special complication in terms of implementation for you, but trying to "interpret" this double as you want for lack of anything else - this is a complication for an applicant, if not to say stronger. While you have to emulate global variables of other types with improvised means - what you could do in the system once, the application developers do in their own place.
 
stringo:

By the way, about the string global variables. You need them to exchange string data between programs within one client terminal, right? So why not pass the strings directly, via user events? It's much more efficient method than data exchange via global variables.

These are completely different things. State must be stored and accessible, while messages are a means of changing states.
 
marketeer:
A familiar reasoning: you make life easier for yourself and harder for the users, although the program seems to be written for them. There is no special complication in terms of implementation for you, but trying to "interpret" this double in any way, for lack of anything else - this is a complication for the user, if not to say stronger. While you have to emulate global variables of other types with improvised means - what you could do in the system once, the application developers do in their own place.

Why emulate anything? You can store any type of data in the 8 bytes of a global variable, except string. If it is data of type double, you directly use the resulting value. If it is data of another type, then you need one additional copying operation of simple structures to get the data of the right type.

 
stringo:

Why emulate anything? You can store any type of data in the 8 bytes of a global variable, except string. If it is data of type double, you directly use the resulting value. If it is of another type, you need one additional copying operation of simple structures to get the data of the right type.

I was primarily interested in strings.