returns the execution policy. - page 5

 
Ivan_Invanov:
Please clarify the situation with operators == and !=. If compared variables are represented as true when they have any non-zero value (in help it is written so). How arrays are represented then? And why in this example there is a comparison "not equal to two", why exactly two, if any non-zero value is true, if there is no difference, if it was 1, why does it say exactly 2 ? Here is code from official example (from Moving Average 2009-2017 v1.00 line 132).

1. Is it true that any non-zero value is true when compared in the operators "==" , "!=" ?

2. How is an array represented? How can it be compared to a number at all?

3. Why is there a "2" in the comparison ? If according to the help truth is any non-zero value, then it is logical to write "1".

4. Did the condition if CopyRates got an error ?

Read carefully in documentation what function CopyRates() returns and you will understand everything.

 
Alexey Viktorov:

Read carefully in the documentation what the CopyRates() function returns and you will understand.

I made this list of questions on purpose, to get a detailed answer, not a one-syllable and not another reference. If you want to help, please answer the questions in order.
 
Ivan_Invanov:
I have purposely compiled this list of questions to get a detailed answer, not a one-syllable one and not another reference. If you want to help, please answer the questions in order.
I read the help, it says it returns -1, where will it go, in integers or arrays? If it is an invalid value in arrays, should it be integer? What about relational operators ?
 
Ivan_Invanov:
Please clarify the situation with operators == and !=. If comparable variables are true when they have any non-zero value (the reference says so). How arrays are represented then? And why in this example there is a comparison "not equal to two", why exactly two, if any non-zero value is true, if there is no difference, if it was 1, why does it say exactly 2 ? Here is code from official example (from Moving Average 2009-2017 v1.00 line 132).

1. Is it true that any non-zero value is true when compared in the operators "==" , "!=" ?

2. How is an array represented? How can it be compared to a number at all?

3. Why is there a "2" in the comparison ? If according to the help truth is any non-zero value, then it is logical to write "1".

4. Did the condition if CopyRates got an error ?

CopyRates() returns int, not bool. Copy two bars (4th parameter) and check that 2 are copied.

 
Ivan_Invanov:
I made this list of questions on purpose, to get a long answer, not a one-syllable one and not another bounce. If you want to help, please answer the questions in order.

Well, if you can't read it there, read it here:

Return value

Number of copied array elements or -1 in case of error.

Returns the number ofcopied elements. It is scheduled to get 2 elements and the query is set to 2. If the function returns any number except 2, something is wrong. And it has nothing to do with the array values.

 
Dmitry Fedoseev:

CopyRates() returns int, not bool. Copy two bars (4th parameter) and check that 2 bars are copied.

How can we check that there are 2 copied, if any non-zero value is true in this statement?
 
About true and false. If we were comparing like this: if(2){} or if(-1){} - they would all be true. But the comparison is performed for equality of two numbers x==2, so this expression may be true or false. If x equals 2, then true, otherwise false.
 
Dmitry Fedoseev:
About true and false. If they were compared like this: if(2){} or if(-1){} - then they are all true. But a comparison is performed for equality of two numbers x==2, so this expression may be true or false. If x equals 2, then true, otherwise false.

According to you 2==2 is true and for example 1234==2 is false. But the help says that any non-zero value in this operator is true, so 1234==2 is true.

 
Alexey Viktorov:
Ward 6... Excuse me.

This is from the reference

Files:
1111.jpg  29 kb
 
Ivan_Invanov:

It's from the reference.

Sorry again. Didn't have time to delete...

You can only answer "YES" or "NO".

  • 2 equals 2.
  • 1234 equals 2.
Waiting for two answers from you.
Reason: