Библиотеки: Input_Struct - страница 6

 
    this.Inputs.UseOpenLongOrder = true;
    this.Inputs.UseOpenShortOrder = true;
    Inputs = "UseOpenLongOrder = false"; //

There is also a BUG, ​​both variables have become false. //this.Inputs.UseOpenLongOrder = false;  this.Inputs.UseOpenShortOrder = false;

 

Sorry, the above errors are due to my previous modifications. They are not wrong in themselves. I will check again.

 
  static string GetString_INPUT_STRUCT( const string &Str, const string StrMatch, const int PosIndex = 0 )
  {
    string StrOut = NULL;

    const int Len = ::StringLen(StrMatch + "=");;
    int Pos = ::StringFind(Str, StrMatch + "=");

    while (Pos != -1)
      if (!Pos || (Str[Pos - 1] == ',') || (Str[Pos - 1] == '\n'))
        break;
      else
        Pos = ::StringFind(Str, StrMatch + "=", Pos + Len);

    if ((Pos != -1) && (!Pos || (Str[Pos - 1] == ',') || (Str[Pos - 1] == '\n')))
    {
      Pos += Len;
      int PosEnd = ::StringFind(Str, ",", Pos);
      if (PosEnd == -1) PosEnd = (int)Str.Length();
      
      if (PosIndex)
      {
        PosEnd = ::StringFind(Str, "\n", Pos);

        if (PosEnd == -1)
          PosEnd = ::StringLen(Str) - 1;

        for (int i = 0; i < PosIndex; i++)
        {
          Pos = ::StringFind(Str, "||", Pos);

          if ((Pos != -1) && (Pos < PosEnd))
            Pos += 2;
          else
          {
            Pos = -1;

            break;
          }
        }

        StrOut = (Pos == -1) ? "" : ((PosIndex == 4) ? ((Str[Pos] == 'Y') ? "1" : "") : ::StringSubstr(Str, Pos, PosEnd - Pos));
      }
      else
        StrOut = ::StringSubstr(Str, Pos, PosEnd - Pos);
    }

I only added these few lines of code, and now the test is no problem for me

 
hini #:

Смогу посмотреть только через несколько дней.

 
Author, I have an idea to check each input parameter, for example: SINPUT(MinLots, double, 0.01, 0.01,1) MinLots is between 0.01-1, if it is 0, Inputs.FromString returns false
 
hini #:

我发现了另一个奇怪的错误。当 INPUT 包含字符串时,字符串后面的所有参数都会重复一次。请使用以下输入参数进行验证

hini #:

There is also a BUG, ​​both variables have become false. //this.Inputs.UseOpenLongOrder = false;  this.Inputs.UseOpenShortOrder = false;

Thanks, fixed.

 
Very good!
 
    // https://www.mql5.com/ru/forum/460726/page5#comment_54491662
    #ifdef __MQL5__
    if ((::_LastError == ERR_WRONG_STRING_PARAMETER) && (::_LastError != PrevLastError))
      ::ResetLastError();
    #endif 

I forgot to mention that this error handling is only for mql5, mql4 does not have this error.

 
hini #:

I forgot to mention that this error handling is only for mql5, mql4 does not have this error.

Thanks, fixed.