Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 567

 
What's the warning?
 
hoz:

AlexeyVik, Vladon,


Seems like a normal code. Should we ignore these warnings?


What's normal there?

void fCreat_StrToInt (string& fsa_Value[],                                     // Массив элементов string
                      int& fia_OUT[],                                          // Возвращаемый массив int
                      int fi_IND,                                              // Количество ячеек в массиве
                      int fi_Factor = 1,                                       // Множитель
                      string fs_NameArray = "")                                // Имя возвращаемого массива
{
    int    li_size = ArraySize (fsa_Value);
    string ls_row = "";
//----
    ArrayResize (fia_OUT, fi_IND);
    
    for (int li_int = 0; li_int < fi_IND; li_int++)
    {
        if (li_int < li_size)
        {
            fia_OUT[li_int] = StrToInteger (fsa_Value[li_int]) * fi_Factor; // это верно
        }
        else
        {
            fia_OUT[li_int] = StrToDouble (fsa_Value[li_size - 1]) * fi_Factor; // Это НЕ ВЕРНО !
        }
        ls_row = StringConcatenate (ls_row, fs_NameArray, "[", li_int, "] = ", fia_OUT[li_int], "; ");
    }
    
    if (fs_NameArray != "") Print (ls_row);

You have a type mismatch (highlighted in red): You are trying to pass a value of type double into type int, which has a much wider value range than int. There may be a loss of value. Surely the compiler warns you about this.
 
Vladon:
What's the warning?
possible loss of data due to type conversion
 
VladislavVG:

What's normal about it?

You have a type mismatch (highlighted in red): You are trying to pass a value of type double into type int, which has a much wider range of values than int. There may be a loss of value. Surely the compiler warns about it.
But what about the implicit type conversion? Although I agree that this may cause an error. You'd better convert via StrToInteger right away.
 

How do I calculate the number of characters?

And how do I know if it is a day off (Saturday, Sunday)?

 
hoz:
What about implicit type conversion? Although I agree, it may cause an error. Better to convert directly via StrToInteger.

If you were passing the int in double, there would be no problem. You would be passing a value of a type with a smaller range to a type with a larger range. And there would be no possible loss of data. And, consequently, there would be no warning either.
 

Hi all!

The MQL4 documentation has changed. The tutorial has not changed.

To use the new features of MQL4 it is necessary to study the MQL5 tutorial ?

Or is there another special literature?

 
kosmos0975:

Hi all!

The MQL4 documentation has changed. The tutorial has not changed.

To use the new features of MQL4 it is necessary to study the MQL5 tutorial ?

Or is there another special literature?

No, you don't. If you study 4, study documentation for 4. Although, if anything, the two are somehow intertwined.

As I see it, the compiler is now unified (you can write for both 4 and sub-4). That's why the documentation is the same, except for some differences. Generally, I advise to read documentation for 4 and stay away from 5. It is more complicated, at first sight. You won't lose anything from it.

 
I accessed a live account through the company Teletrade from my computer and my tablet does not open a live account the tablet is running on android 4.2.2. what is the reason?
 
hoz:

No, you don't. If you study 4, study the documentation for 4. If anything, though, the two are somehow intertwined.

As I see it, the compiler is now unified (you can write for both 4 and sub). That's why the documentation is the same, except for some differences. Generally, I advise to read documentation for 4 and stay away from 5. It is more complicated, at first sight. You won't lose anything from it.


The description of the functions in the documentation looks cumbersome, unfamiliar, complicated.

A beginner in many ways may not find parallels between the old textbook and the new documentation.

Maybe they will make reference to the old documentation or . new textbook.

I will definitely reread it.