Self-learning the MQL5 language from scratch - page 2

 
Fast235:

I assure you, you will come back to it, to all the topics, especially string, it is the most difficult one)

Thanks for your help and suggestions!

Regards, Vladimir.

 

While there are no new messages from forum members, I'm studying Dmitry Fedoseyev's article https://www.mql5.com/ru/articles/2744

At first the article was clear and understandable, until I got to the section Viewing all global variables, where the code for the script is spelled out. Everything seems to be clear, but in the code:

   Alert("=== Начало ===");
   int total=GlobalVariablesTotal();
   for(int i=0;i<total;i++){
      Alert(GlobalVariableName(i)," = ",GlobalVariableGet(GlobalVariableName(i)));
   }

it's not clear what it means:

(int i=0;i<total;i++)
int is an integer data type that is 4 bytes (32 bits) in size. The minimum value is -2,147,483,648, the maximum value is 2,147,483,647. This is clear.

But next it says i=0;i<total;i++ What does i mean? Is it a variable or something? Could any other variable be written instead of i or not? And why did this line appear at all?

The same " = ". What is it, what is it for? I could not find it in MQL5 Reference. It seems to be a trifle, but without it, I, as a beginner, cannot understand the code in general.

Best regards, Vladimir.

 
Maybe you should have a look at an old C++ primer, Schildt's maybe. Without going too deep. Types, operators, that's where it's all well chewed up.
 
Andrei Novichkov:
Maybe you should flip through an old C++ beginners textbook, Schildt's maybe. Without getting too deep. Types, operators, that's where it's all well chewed up.

please don't spoil the training.

the links to additions and fcnctions are not as complicated as the time-series, where and how they come from

 

Correct me if I have misunderstood the meaning of this code:

   for(int i=0;i<total;i++)

the variable i, which has an integer data type, is assigned a value equal to zero, a value less than total and a value greater by one. Is it correct?

Sincerely, Vladimir.

 
Andrei Novichkov:
Maybe you may thumb through an old textbook on C++ for beginners, maybe Schildt. Without going too deep into it. Types, operators, it's all well chewed up there.

Thank you, Andrey! That's what I've been waiting for, advice on where to start. I'll finish reading the article by Dmitry Fedoseyev and look for the textbook.

Regards, Vladimir.

 
MrBrooklin:

Correct me if I misunderstood the meaning of this code:

the variable i, which has an integer data type, is assigned a value equal to zero, a value less than total and a value greater by one. Is it correct?

Sincerely, Vladimir.

The line is correct, it will be +1 until the value reaches total

 

You are just confused because the information is overwhelming.

Set yourself a task, for example to open a transaction programmatically

Dig into the codebase, match any small code with documentation and you'll be all set

MQL5 Code Base
MQL5 Code Base
  • www.mql5.com
На главном графике символа отображаются моменты пересечения основной и сигнальной линии стандартного индикатора iStochastic (Stochastic Oscillator, STO). Добавлены уведомления при возникновении сигнала
 
Renat Akhtyamov:

You are just confused because the information is overwhelming.

Set yourself a task, for example to open a transaction programmatically

Dig into the codebase, cross-reference any little code with the documentation and everything will be

Yes, now he's going to read a textbook and get bogged down in even more mush.

read post 2 here, it's the only true learning rule)
 
Fast235:

the string is correct, it will be +1 until the total value is reached

In other words, this line is an enumeration of all variable values? Is it correct?

Regards, Vladimir.

Reason: