Bug in debugger watch window?

 


Why is the value 1 when i multiply by (1) in brackets?? Am I missing something here?

size*(2) = 2

But it seems those are the not values actually used in the code.



In the watch window, multiplying by something in (brackets) causes the value to appear as whatever is in the brackets.

 

1. Always show the FULL code. Show code that can be loaded into the editor once.

2. Here is the code:

//+------------------------------------------------------------------+
//|                                                     Script 1.mq5 |
//|                        Copyright 2020, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property script_show_inputs
//--- input parameters
//---
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
   int size=2251;
   int temp_a=size*(2);
   int temp_b=size*2;
   double a=size*(2);
   double b=size*2;
   int d=0;
  }
//+------------------------------------------------------------------+

3. Here is the result:



Terminal:

MetaTrader 5 x64 build 3020 started for MetaQuotes Software Corp.
Windows 11 build 22000, Intel Core i7-9750H  @ 2.60GHz, 22 / 31 Gb memory, 813 / 947 Gb disk, IE 11, UAC, GMT+2
C:\Users\barab\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075
Files:
Script_1.mq5  2 kb
 

In the EXPRESSION WINDOW please write

size*(2)
 
WorthyVII :

In the EXPRESSION WINDOW please write

Check out the help for converting variables. I gave you a step-by-step example.

 
Vladimir Karputov:

Check out the help for converting variables. I gave you a step-by-step example.

Vladimir I appreciate you trying to help, but I don't understand your point.
I am not asking for help with coding.

I am reporting a clear bug with the Watch/Expression window whereby if you write any kind of expression that uses brackets, like something*(2), then in the value area, it shows 2 instead of the real result.

What are you trying to tell me that is related to this problem?



 
WorthyVII:

Vladimir I appreciate you trying to help, but I don't understand your point.
I am not asking for help with coding.

I am reporting a clear bug with the Watch/Expression window whereby if you write any kind of expression that uses brackets, like something*(2), then in the value area, it shows 2 instead of the real result.

What are you trying to tell me that is related to this problem?



What makes you think you can use parenthesis in expression watch ?

In the expression observation window, you can perform simple mathematical calculations (addition, subtraction, multiplication and division),...

I am not sure Metaquotes will recognize that as a bug.

Code debugging - Developing programs - MetaEditor Help
Code debugging - Developing programs - MetaEditor Help
  • www.metatrader5.com
MetaEditor has a built-in debugger allowing you to check a program execution step by step (by individual functions). Place breakpoints in the code...
 
Alain Verleyen:

What makes you think you can use parenthesis in expression watch ?

I am not sure Metaquotes will recognize that as a bug.

What makes you think you can use parenthesis in expression watch ?

I can type it and it doesn't throw an error. It appears to be valid input.