Errors, bugs, questions - page 1436

 
Artyom Trishkin:

The funny thing is that ex4 file compiled in my MetaEditor Version: 5.00 build 1214 12 Nov 2015 does not display graphical objects in the terminal of the person to whom I give this file. He also has MT4 terminal, build 910 and MetaEditor Version: 5.00 build 1214 12 Nov 2015.

The indicator source file compiled by him normally creates an executable that works correctly in his terminal.

What are these errors?

Write to servicedesk (attach source code), we will try to reproduce.
 
Alexander:
Write to servicedesk (attach source code), we'll try to reproduce.

OK, written, attached:

Open, Started: 2015.11.23 09:41, #1353961
 
Artyom Trishkin:

OK, written, attached:

Open, Started: 2015.11.23 09:41, #1353961
Thanks
 
Good afternoon everyone. I got to the point of writing EAs. I have typed the code from the example, pressed compile and got an error: EX4 Write error. Please help me to solve this problem. I know that this is probably the 1000th time I am asking this question. I found something on the Internet about this error but did not understand how to fix it. I want to either start Metatrader with /portable parameter or copy MQL4 folder. I am trying to put my hand in this article, I do not know what to do with it.
 
Mehanik85:
Good afternoon everyone. I got to the point of writing EAs. I have typed the code from the example, pressed compile and got an error: EX4 Write error. Please help me to solve this problem. I know that this may be the 1000th time I am asking. I found something on the Internet about this error but did not understand how to fix it. I want to either start Metatrader with /portable parameter or copy MQL4 folder. Help me please.
Please attach the code from the example to reproduce the problem.
 
Well this happens with any EA, even if you create a new one and press compile without code.
 

Compilation error: code generation error. #2

void OnStart()
{
        string text = "" + NULL; //при optimize=1
}
 
void OnStart()
{
   double var1=EMPTY_VALUE*2;
   double var2=var1/var1;
   double var3=42; // Any
   Print("var2 больше var3: ",var2 > var3);
   Print("var3 больше var2: ",var3 > var2);
}

 
Ilya Malev:

Please read the documentation

Some math coprocessor operations can result in an invalid real number, which cannot be used in math and comparison operations because the result of performing operations on invalid real numbers is undefined.

Now pay attention to the question: what is the value of EMPTY_VALUE*2?

 
Slawa:

Read documentation

Now pay attention to the question: What is the value of EMPTY_VALUE*2?

1. Why in MT4 and MT5 this code leads to a different result (more logical in MT4)?

2. How can I determine at runtime whether the number is valid or not (for example, so that the sorting algorithm doesn't loop because of it)?