[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 1087

 
itum:

I HAVE A PROBLEM ....

When I set up mail in the terminal settings, In SMTP - I use smtp.gmail.com:25

I get the error - Mail: 530 5.7.0 Must issue a STARTTLS command first. l3sm2329679fan.0

The SMTP server on the mail.com server requires RFS-2554 authentication. What is it I do not know - but in the bat I had to duplicate password and login box on mail.ru, that konakt rolled. Without it stopped working - a few years ago it worked, and then they changed something there. Try smtp.rambler.ru with the same 25th port - maybe it will work.
 

Man, I'm confused by the terms. What I meant to say is that if help binds us strictly to one place in program structure, where static variable must be declared and initialized, and only once, then all other attempts to assign any other value to this variable, or assign any value to it at all, should be treated by the compiler as a syntax error. In other words, based on the definitions given in the help, static variables serve as containers for constants and cannot be changed while the program is running. Full stop. But alas, we have just come across 2 violations of this rule. It turns out that you may declare a static variable anywhere and reinitialize it anytime. Well, they should have written it in the help.

We have also found out that this variable is global at the main program level even if it is declared in a subprogram.

This is the first time I've encountered the folly of declaring a global variable inside a subroutine - it's confusing to understand program code. Variables that are declared within subroutines have a lifetime equal to or less than that of a subroutine. It's a classic. Why the metaquotes needed the perversity of declaring a global variable inside subroutines, one can only wonder.

 
khorosh:

There is also an example in the tutorial of using a static variable, from which it is clear that it is initialized once, otherwise the tick counter would not work.


The author of the tutorial has broken the help rule - a static variable is initialized before the init() function. The question is how can we initialize a variable, which hasn't been declared yet? That's right - you can't. So consequently, the static variable must be declared before the init() block. It's a simple categorical syllogism. If A, then B. A, therefore B is the asserting modus of the categorical syllogism. If there is a prohibition to initialize an uninitialized variable (A), then it must be declared first (B), the prohibition exists (A), hence a prior declaration of the variable is necessary (B).

It turns out that the author not only initialized the static variable not before the init() block, but also declared it in the wrong place in the program where the help is required!

 

Shit, that's where it's buried. Found it! https://docs.mql4.com/ru/basis/variables/initialization

Любая переменная при определении может быть инициализирована. Любая переменная инициализируется нулем (0), если явно не задано другое начальное значение. Глобальные и статические переменные могут быть проинициализированы только константой соответствующего типа. Локальные переменные могут быть проинициализированы любым выражением, а не только константой.

Инициализация глобальных и статических переменных производится однократно. Инициализация локальных переменных производится каждый раз при вызове соответствующих функций.

The authors of the help are confused about the term initialisation. The first paragraph is correct - the term "initialization" is applied in the sense of an assignment operation - that is, to initialize a variable with a value is to assign a value to it. In the second paragraph, instead of "declaring a variable" ("defining a variable"), the author of the help mistakenly used the term initialisation. Therefore, the judgement "Initialization of global and static variables is done once." should read as "Declaration of global and static variables is done once." Otherwise we will get an absurdity. If initialization is possible only once, the values of these variables cannot be changed at run-time. Developers, please fix these and the errors shown in several posts above!

P.S.

I confused "variable initialization" with "variable declaration". I put a lot of wrong terms in the above posts. :(

 
drknn:

Shit, that's where it's buried. Found it! https://docs.mql4.com/ru/basis/variables/initialization

The authors of the help are confused about the term initialisation. The first paragraph is correct - the term "initialization" is applied in the sense of an assignment operation - that is, to initialize a variable with a value is to assign a value to it. In the second paragraph, instead of "declaring a variable" ("defining a variable"), the author of the help erroneously used the term initialisation. Therefore, the judgement "Initialization of global and static variables is done once." should read as "Declaration of global and static variables is done once." Otherwise we will get an absurdity. If initialization is possible only once, the values of these variables cannot be changed at run-time. Developers, please fix these and the errors shown in several posts above!

P.S.

I confused "variable initialization" with "variable declaration". I put a lot of wrong terms in the above posts. :(

The fact that initialisation is a one-time operation does not mean that an assignment operation, which can change the value of a static variable, cannot be performed during program execution. The difference between these operations is that in initialization, the declaration of the variable type is combined with the assignment of its original value either explicitly or implicitly. As for the declaration of a static variable before init() or inside any function, this affects the ability to call this variable only from the function where it is declared, or from any other function.
 

Happy holidays, everyone. Help a dummy! Please advise on a decent EA. Cents account Depo for now 60$

 
khorosh:
Because initialization is a one-time operation, it does not follow that assignment, which can modify a static variable's value, cannot be performed in the middle of program execution. The difference between these operations is that in initialization, the declaration of a variable type is combined with an explicit or implicit assignment of its original value. As for the declaration of a static variable before init() or inside any function, this affects the possibility to call this variable only from the function where it is declared or from any other function.


Understand that while the concepts of attribution and identification are equivalent, their volumes are the same! This means that the two terms are synonymous!!!

Let's go deeper into the question to its original source. We open an English online dictionary. Trying to translate the term identification yields nothing - it translates as identification. The word is not a native one, so we cannot understand what it means from the online dictionary. You go to Google and download Borovsky's book "English-Russian Dictionary of Programming". On page 128 we find the following: http://s2.ipicture.ru/uploads/20101230/XwOJxmkn.jpg All that remains is to find out what an identity is. Open Ozhegov's Dictionary. Find the dictionary entry:

Identity, -a and Identity. -a, cf. 1. The complete similarity, coincidence. D. views. 2. (identity). In mathematics: equality, true for any numerical values of its constituent quantities. II adjective identical, -a, -a, and identical, -a, -a (to the 1st sense). Identical algebraic expressions.

That's what it takes to prove! Well, since after an assignment operation, the value of the variable will be exactly the same as the one just assigned to it, we conclude that identification of a variable and identification of a variable are one and the same operation, which is exactly equal to the assignment operation. Therefore, we are forced to conclude: If a rule assigns one and only one identification to a variable, and in a strictly specified place in the program structure, then we have no right to assign another value to that variable (after its identification), because the concept of identification and the concept of assignment are synonymous! Full stop.

 
drknn:


Just realize that while the concepts of attribution and identification are equivalent, their scopes are the same! This means that the 2 terms are synonymous!!!

We go deep into the question to its original source. Open the English online dictionary. Trying to translate the term identification yields nothing - it is translated as identification. The word is not a native one, so we cannot understand what it means from the online dictionary. You go to Google and download Borovsky's book "English-Russian Dictionary of Programming". On page 128 we find the following: http://s2.ipicture.ru/uploads/20101230/XwOJxmkn.jpg All that remains is to find out what an identity is. Open Ozhegov's Dictionary. Find the dictionary entry:

What was required to prove! Well, since after the assignment operation, the value of the variable will be exactly the same as the value just assigned to it, we conclude that the identification of a variable and the identification of a variable are one and the same operation, which is exactly the same as the assignment operation. Therefore, we conclude: If a rule assigns one and only one identification to a variable, and in a strictly specified place in the program structure, then we cannot assign another value to that variable (after the identification), because the concept of identification and the concept of assignment are synonymous! Full stop.

Are you suggesting that initialisation and identification are the same thing?
 
khorosh:
Are you suggesting that initialisation and identification are the same thing?

No, stop - don't confuse me. Wait a minute.
 
drknn:

No, stop - don't confuse me. Wait a minute.
Initially you were talking about initialisation, but for some reason you switched to identification.