Errors, bugs, questions - page 1086

 
The comma (,) operation works only in a loop and not always
bool f1( int a, int b ) { return ( a > b ); }

bool f2( int a )
{
        int i;
        for( Print( i ), i = 1;               i < 3;  Print( i ), i++ ); //нормально
         for( Print( i ), i = 1; (Print( i ), i < 3); Print( i ), i++ ); //ошибка компиляции
        bool b = f1((Print( i ), 1), 0) // ошибка компиляции
	int j;
	j = Print( 1 ), i;              // ошибка компиляции
         int k = (Print( 1 ), i);        // ошибка компиляции
        return (Print( 1 ), true);       // ошибка компиляции
}

In function arguments, during expression calculation, during initialization and in return - compilation error

The MQL5 Reference says:"The type and value of the result is the same as the type and value of the right-hand expression". But this property has not been implemented, as we can see from the examples. There is no confusion in function arguments and in initialization, because such expression is enclosed in brackets (,)

 
A100:
The comma (,) operation only works in the loop and not always

This was only for the sake of compatibility with the existing (horrible) C/C++ code.

Please God forbid you to write it that way. Any such use of a comma should be forbidden.

 
bas:
And the instrument archive is written in different folders, and there are no overlaps, crossings, etc., the markup on the charts is not lost? And in order to test on an instrument which the current broker does not have, do you have to switch to another one's server?

From the terminal's help:

Profiles

Profiles are intended for convenient work with groups of charts. Profiles are memorised:

-chartsthat were opened when the profile was saved

-Locationand size of these charts;

-templatesthat were applied to these charts.

For example: Profile "EURO". A line was drawn on the "EURUSD D1" chart. After switching to another broker, the "EURUSD D1" chart will also open with the line drawn. Or better yet, just try it yourself.

 
barabashkakvn:
Help is help, but I once had everything in the terminal cleared during an update, so now I try not to experiment.
 
Renat , can you tell me something about my bug, I'm waiting for the third day.
 
bas:
Renat , please advise me on my bug, I've been waiting for three days.
You have already been answered.
 
Well, yes, and I replied that the internet had nothing to do with it.
 
bas:
Help is help, but I once had an update that cleared everything in the terminal, so now I try not to experiment.
J You've probably lost your default profile. I, on the other hand, create my own profile so I don't depend on the defaults. My profiles have never been overwritten.
 
this allows you to bypass const
class A {
        void f() const;
        int i;
};

void A::f() const
{
        i = 0;      //ошибка     - правомерно
        this.i = 0; //нет ошибки - обходим const
}
 
A100:
this allows you to bypass const
Thank you, we'll fix that.