Errors, bugs, questions - page 2954

 
MetaQuotes:

Please update to beta version 2775.

This has been fixed.

//+------------------------------------------------------------------+
void OnStart()
  {
   struct s_My
     {
      int            a;
      double         b;
      long           c;
     } my1;

   my1.a=33;
   my1.b=44.44;
   my1.c=-55;


   Print(my1.c);
  }


There is also this

 
MetaQuotes:

Please update to beta version 2775.

This has been fixed.

Thank you, it has helped. But the visual tester can't run in this beta, just in case.

up: is there no function to rollback from beta to release? that would be handy.

 

Compilation error


It compiled fine before - no error

 
A100:

Compilation error

It was compiling all right before - no error

I had that when I ran out of disk space.

 
Vladimir Pastushak:

This happened to me when I ran out of disk space.

There is more than enough free space - after several unsuccessful attempts I saved the compiled file in the same folder under a different name and everything was normal. The .ex5 file itself of the previous version (script) runs fine as well - no errors

 
Compilation error not corrected
template<typename T>
class A {
public:
        void f( int ) {}      //(1)
};
class B : public A<int> {
public:
        void f( int, int ) {} //(2)
};
void OnStart()
{
        B b;
        b.A<int>::f( 1 ); //Error: 'A' - undeclared identifier
}
 
A100:
A contradictory result:

So you've 'gone beyond' ULONG

Print(string(ULONG_MAX));
2021.02.07 23:09:41.060 SFQ_data (Si-3.21,M1)   18446744073709551615
 
prostotrader:

So you've "gone beyond" ULONG

Yes, found a non-obvious rule that in case of overflow the extreme value is returned

 

If Expert is converted to Indicator, then after recompiling, at least the standard icon in the Navigator window does not change immediately, but only after restarting the Terminal. The Refresh menu in the same place - does not help

Expected: immediately

 
A100:
Compilation error not corrected
template<typename T>
class A
  {
public:
   void              f(int) {}        //(1)
  };

class B : public A<int>
  {
public:
   void              f(int, int) {}   //(2)
  };

void OnStart()
  {
   B b;
//--- да, жаль, что не работает именно так, как вы написали, но
//если очень надо чтобы заработало без предупреждений компилятора
//касательно вызова скрытого метода, то можно попробовать вот такой
//временный костыль, пока не исправят
   A<int>* a_1=dynamic_cast<A<int>*>(&b);
//--- или вот так
   A<int>*a_2=(A<int>*)&b;
   a_1.f(1);
   a_2.f(1);
  }


//--- либо совсем вот так
template<typename T>
class A
  {
public:
   void              f(int) {}        //(1)
  };
class B : public A<int>
  {
public:
   void              f(int, int) {}   //(2)
   void              f(int x) {A<int>::f(x);}
  };
void OnStart()
  {
   B b;
   b.f('х'/'з');
  }
Reason: