Why?

 

Why does this

SomeDouble=SomeDouble*-1;

Causes a ea to fail to compile, while this

SomeDouble=-1*SomeDouble;

Works fine?

 
tonny:

Why does this

Causes a ea to fail to compile, while this

Works fine?

Because . . . https://www.mql5.com/en/forum/147356
 
So is this a bug in mt4?
 
tonny:
So is this a bug in mt4?

Nope, not a bug . . . would you expect this to work ?

SomeDouble = SomeOtherDouble * + 10;
 
RaptorUK:

Nope, not a bug . . . would you expect this to work ?

But i think the ide can be made to tolerate it like other ide's.
 
tonny:
But i think the ide can be made to tolerate it like other ide's.
Maybe . . . I don't find it an inconvenience.
 
RaptorUK:

Nope, not a bug . . . would you expect this to work ?

It could, but not with mql4 designed at this moment.

However it will probably work with the new compiler (as in mql5). A lot of programming language have the concept of unary, binary and even ternary operator. (as a side note mql4 documentation and book use incorrectly the word operator, probably a wrong translation).