Discussing the article: "Master MQL5 from Beginner to Pro (Part III): Complex Data Types and Include Files"
I am a beginner who has learnt the basics of programming. I have read your next article and made a conclusion: a beginner with complete lack of any knowledge will not understand anything from this article. This is my personal opinion, not claiming to be the truth in the last instance.
Let's take the Structures section of the article as an example. The beginning is good and clear enough. You have told what the structure is for and shown how to create it. And then bang, and new code!
IntradayTime dealEnterTime; dealEnterTime.hours = 8; dealEnterTime.minutes = 15; dealEnterTime.timeCodeString = "GMT+2";
I have highlighted this part of the code on purpose. What should a beginner with zero knowledge understand from this line? What is it for him? I already understand it, but for a beginner with no knowledge it is another incomprehensible code fragment. That's why it is desirable to describe and fully explain each line. Otherwise it turns out that this article is not for beginners but for advanced programmers.
Regards, Vladimir.
I am a beginner who has learnt the basics of programming. I have read your next article and made a conclusion: a beginner with complete lack of any knowledge will not understand anything from this article. This is my personal opinion, not claiming to be the truth in the last instance.
Let's take the Structures section of the article as an example. The beginning is good and clear enough. You have told what the structure is for and shown how to create it. And then bang, and new code!
I have highlighted this part of the code on purpose. What should a beginner with zero knowledge understand from this line? What is it for him? I already understand it, but for a beginner with complete lack of knowledge it is another incomprehensible code fragment. That's why it is desirable to describe and fully explain each line. Otherwise, it turns out that this article is not for beginners but for advanced programmers.
Regards, Vladimir.
Is it just me - or is it this very structure that I created three lines earlier? And two lines ago I explained that it is a data type? And it should mean that this type should be used the same way as all the others? (Really, logic should be involved here, yes ;-))
Although you're probably right, a comment on the type at least wouldn't hurt.... Thanks.
myVariable.b = 10; //It's ok, you can do it this way
It gives an error during compilation. Can you please tell me what is wrong, where is the error?
myVariable.b = 10; //It's ok, you can do it that way.
I get an error when compiling. Can you please tell me what is wrong, where is the error?
Sorry for the delay in replying.
The code in this example is not quite complete. To make it work, you need to use the myVariable variable somewhere inside the function. For example:
class PrivateAndPudlic { private: int a; public: int b; }; PrivateAndPudlic myVariable; // Global variable void OnStart(){ // All calls to actions (in this case, assignment) must take place only inside functions //myVariable.a = 5; //Compiler error! myVariable.b = 10; //It's okay, it's okay }
Well, you turned the parenthesis around when reprinting it (instead of the opening "{" you put the closing "}" ) ;-)
Sorry for the delay in replying.
The code in this example is not quite complete. To make it work, you need to use the myVariable variable somewhere inside the function. For example:
Well, you turned the parenthesis around when reprinting it (instead of the opening "{" you put the closing "}" ) ;-)
Well, or as described in the article:
void OnStart(){ class PrivateAndPudlic { private: int a; public: int b; }; PrivateAndPudlic myVariable; //myVariable.a = 5; //Compiler error! myVariable.b = 10; //It's okay, it's okay }

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Check out the new article: Master MQL5 from Beginner to Pro (Part III): Complex Data Types and Include Files.
This is the third article in a series describing the main aspects of MQL5 programming. This article covers complex data types that were not discussed in the previous article. These include structures, unions, classes, and the 'function' data type. It also explains how to add modularity to your program using the #include preprocessor directive.
In this article I will describe how a programmer can create complex data types:
The article also describes how to include external text files using the #include preprocessor directive to ensure our program is modular and flexible. Let me remind you that data can be organized in different ways, but the compiler must always know how much memory our program will need, and therefore before using the data, it must be described by specifying its type.
Author: Oleh Fedorov