Errors, bugs, questions - page 1298

 

syntax error

struct S {};
class A {
        int S() { return 1; }
        int f() { return S(); } //syntax error, если нет уточнения A::S() //а обязательно ли оно ???
};
but this way:
struct S {};
class A {
        void S() {}
        void f() { S(); }
};
OK, so the compiler understands that A::S() is implied and it doesn't have to be explicitly stated
 

Dear Experts, how to implement the function"Apply to: ..." in the custom MA indicator (attached) ? " ?

to be like in the standard Moving Average indicator -"Apply to: First Indikator's Data".

I asked this question on forums, no one knows or says that this possibility isn't available in MQL.

And a question to developers - why the codes of built-in standard indicators are closed and they can't be modified?

Files:
MAchannel.mq4  7 kb
 
Compilation error: constant cannot be modified
class A {};
class B { public:
        const A *a; //здесь не - const A * const a
};
class C { public:
        B b;
        void f( const A *aa ) { this.b.a = aa; } //'a' - constant cannot be modified
};

you cannot assign a pointer to a pointer if the pointer is declared as (const A *) and is a member of a class

but if it is just a class member, then fine

class A {};
class C { public:
        const A *a;
        void f( const A *aa ) { this.a = aa; } //нормально
};
 
Execution error
#define  PRN             Print( __FUNCSIG__ )
class A { public:
        A()       { PRN; }
        void F1() { PRN; }
        void g()  { F1(); PRN; } //здесь пропускает вызов A::F1()
};
class F1 { public:
        F1()     { PRN; }
        ~F1()    { PRN; }
};
void OnStart()
{
        A a;
        a.g();
}
 

I will complete the previous post with a rather rare case of an explicit constructor call

#define  PRN             Print( __FUNCSIG__ )
class A { public:
        A()       { PRN; }
        void g()  { F1::F1(); PRN; } //ошибка компиляции в то время как С++ вызывает безымянные конструктор и деструктор как если бы было ниже
        void f()  { F1 f1;    PRN; } //нормально
};
class F1 { public:
        F1()     { PRN; }
        ~F1()    { PRN; }
};
void OnStart()
{
        A a;
        a.g();
        a.f();
}
 
It would be desirable to add the possibility of spaces and tabs between # and define, ifdef, ifndef, endif, else, undef
#ifdef  MACRO
#        define MACRO1
#else
#        define MACRO2
#endif
If the conditions are complex, it's much easier to read with indentation
 

After #define sometimes comments are possible

#define /*MICRO*/ SOFT //ошибка компиляции
 
A100:

After #define sometimes comments are possible

Thanks for asking, we'll deal with it
 

Icons have significantly lost their clarity

Was build 1060

Became build 1100

Do I need to increase the size at the expense of clarity?

 
A100:

Icons have significantly lost their clarity

Was build 1060

Became build 1100

What screen are you using? What resolution ? What % text size is set in the settings ?
Reason: