Errors, bugs, questions - page 2675

 
Sergey Dzyublik:

Another MT5(build 2316) bug with template class code generation when using internal class.
C++ online:https://onlinegdb.com/HJkKXAqMU

Thanks for the post, fixed

 
Sergey Dzyublik:

Bug MT5(build 2340) Compilation error when attempting to access the internal class for a template parameter of a template function.

Thanks for the post, fixed

 
Ilyas:

What encoding is the file in?

In standard UTF-8

I've tried different encodings and different separators.

The result is either 5008 or hieroglyphs.

 
Sergey Dzyublik:

Two questions immediately for the MT5 compiler (build 2321):

1. The priorities of executing template functions in MQL do not correspond to those of template functions in C++ (online: https://onlinegdb.com/Hkvz8Hu7L).
So in C++, when all three template functions are present, the template function with the result "C++:1" is executed, if it is removed then "C++:2" is executed, and if it is removed then "C++:3" is executed.
The priorities in MQL are quite different: "C++:2" followed by "C++:1" and "C++:3".


It's not clear why the first of the functions is prohibited in MQL, while the identical function with a dummy parameter is already allowed:

Thanks for the message, fixed

 
Vladimir Pastushak:

In standard UTF-8

I've tried it in different ways, with different encodings and different delimiters.

The result is either 5008 or hieroglyphs.

Please provide a working code with a file to investigate

 

On the work of the site:

Balance display in my personal account is a little off, if you can correct it, it's a lot of zeros

Files:
q1.PNG  12 kb
 
Ilyas:

Please provide a working code with a file to investigate

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   core();
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {

  }
//+------------------------------------------------------------------+
void core()
  {
   string value = "", name = "";

   name =  "Test\\Test.csv";
   Print(FileIsExist(name));

   ResetLastError();
 
   int m_hendle = -1;
   m_hendle = FileOpen(name, FILE_READ | FILE_WRITE | FILE_CSV);
   if(m_hendle != INVALID_HANDLE)
     {
      Print((string)m_hendle + "    " + name + " [" + (string)FileSize(m_hendle) + "]"+ (string)GetLastError());
       while(!FileIsEnding(m_hendle))
        {
         string sCurrent = FileReadString(m_hendle);
         Print("sCurrent = ", sCurrent);
        }
      FileClose(m_hendle);
     }
  }
//+------------------------------------------------------------------+
Files:
Files.zip  1 kb
 
Sergey Dzyublik:
In C++ it compiles and works (online: https://onlinegdb.com/Syn90dd7I), but in MQL the error: "'func' - ambiguous call to overloaded function"

Thanks for the post, fixed

 
Vladimir Pastushak:

In standard UTF-8

I've tried it in different ways, with different encodings and different delimiters.

The result is either 5008 or hieroglyphs.

The encoding is ANSI, it will only work in Russian Windows.

Add FILE_ANSI flag, when opening a file

m_hendle = FileOpen(name, FILE_READ | FILE_WRITE | FILE_CSV | FILE_ANSI);
 
Sergey Dzyublik:
Bug MT5 (build 2340) when an internal struct is passed to a template function, the resulting data type cannot be used as a base data type for another internal struct in a template class:

Thanks for the post, fixed