Discussion of article "Library for easy and quick development of MetaTrader programs (part XIX): Class of library messages"

 

New article Library for easy and quick development of MetaTrader programs (part XIX): Class of library messages has been published:

In this article, we will consider the class of displaying text messages. Currently, we have a sufficient number of different text messages. It is time to re-arrange the methods of their storage, display and translation of Russian or English messages to other languages. Besides, it would be good to introduce convenient ways of adding new languages to the library and quickly switching between them.

It took me a while to decide on what to display for visual testing. Finally, I decided that all has already been done. Messages already appear in the journal. Therefore, in order to verify them in a new version of storing and displaying data, we should simply launch the EA from the previous article: \MQL5\Experts\TestDoEasy\Part18\TestDoEasyPart18.mq5.
Let's save it in the new directory under the name \MQL5\Experts\TestDoEasy\Part19\TestDoEasyPart19.mq5.
Nevertheless, I have made some minor changes in it. They are related to the size of tracked changes and the look of displayed texts, therefore there is no point in describing them here.

Compile and launch the EA in the tester in visual mode. The EA tracks the values of a spread, a profit and funds. So, let's have a look at the messages related to a spread change and its crossing of the value of 2 points. Upon an increase of funds, positions are closed. The appropriate entries about all the actions, including opening/closing positions, should be displayed in the journal. We are already familiar with them from the previous articles' tests. Here, we are mostly interested in their correct display since they are now stored and displayed in a completely different way. All messages are stored in one place and displayed upon specifying their location in the message database.

Let's have a look:


We can see that all event entries are displayed correctly, which means that everything works as intended.

Now we have the message class with the common database of all library texts. Besides, we have all the descriptions to all trade server return codes and runtime errors. The access to all messages is performed by an error code or a message ID.

Author: Artyom Trishkin

Reason: