Errors, bugs, questions - page 1369

 
Alexander Laur:
The question is: is arbitrage possible in forex?
))) "and do you believe in dickfix?"
 
A significant argument for the introduction of * (which has not been voiced before) may be the following:
class A { public:
        virtual bool    operator==( A& ) { Print(__FUNCSIG__); return true; }
        virtual bool    operator==( A* ) { Print(__FUNCSIG__); return true; }
};
void today( A *a, A *b )
{
        a == b;            //сравниваются указатели на равенство
        a.operator==( b ); //вызывается a.operator( A* )
//нет синтаксиса вызова a.operator( A& )
}

so one cannot call a.operator( A& ) even explicitly, which is significant

In this case, introduction of * together with making the operation of pointer comparison into a separate function (perhaps a system function) will resolve all the existing ambiguities
void future( A *a, A *b )
{
        a == b;         //вызывается a.operator( A* )
        a == *b;        //вызывается a.operator( A& )
        ::IsEqualPointer( a, b ); //сравниваются указатели на равенство
}
If it was optimal, it will become ideal!

We have added operators *(Dereference/Inderection) and &(Address-of), we are not going to make any additional changes in the language
A *a,*b;

 a== b;   // сравнение "указателей"
*a== b;   // вызов оператора ==(A *)
 a==*b;   // вызов оператора ==(A &)

// для операции != аналогично

// операция & - эквивалент(короткая запись) вызову GetPointer
 
Ilyas:
Added operators *(Dereference/Inderection) and &(Address-of)
Sweet!
 
Ilyas:

Added operators *(Dereference/Inderection) and &(Address-of), no additional changes in the language will be made/planned
Is this only in MQL5 or in MQL4, too?
 
Konstantin Karpov:
is this only in MQL5 or has it been added to MQL4 as well?
Added to both languages. Unfortunately, it won't appear in the next build.
 
I'd like to know about the prospect of introducing property (as a class member). I asked this question recently, but there were no comments from the developers. Is it planned, or should I do a poll on the forum as to whether this feature is needed?
 
Alexey Navoykov:
I'd like to know about the prospect of introducing property (as a class member). I asked this question recently, but there were no comments from the developers. Is this planned, or should I do a poll on the forum as to whether this feature is needed?
This question is under consideration.
 
Here's another inconvenience. When we try to implement something like this
a.b().c().d();

then after the first pair of parentheses, the auto-substitution list with class member names stops popping up, and all further text has to be typed completely manually/blindly.

 
Alexey Navoykov:
Here's another inconvenience. When trying to implement something like this:

then after the first pair of parentheses, the auto-substitution list with class member names stops popping up, and all further text has to be typed completely manually/blindly.

It would be nice to add to debugger a hint about type of used variable, like in all advanced IDEs
 

boolFileIsExist(
const stringfile_name,//file name
intcommon_flag=0// search area
);

The file being checked can be a subdirectory. In this case FileIsExist() will return false, and error 5018 will be written to the _LastError variable - "This is not a file, but a directory". (see example for FileFindFirst function).

5018 does not work in subfolders/subdirectories

For example if

and the example https://www.mql5.com/ru/docs/files/filefindfirst would have

input string InpFilter="Dir1\\*"

the result would be

and it should be 1: Directory = Dir2\.

Документация по MQL5: Файловые операции / FileFindFirst
Документация по MQL5: Файловые операции / FileFindFirst
  • www.mql5.com
Файловые операции / FileFindFirst - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5