Debugger crash array out of range, observation gone

 

Hi everybody. Each time that I have an array out of bounds error in some MQL5 program while debugging with variable observation, Debugger won't react. Then I can only close it and usually the EA/Indi that I was testing has to be reopened. Asides from that the variables that I picked for observation in debugger are all gone. While with normal variables this doesn't seem like such a big problem, it can be very tedious work when working with a structure because you can't mark the thing by double clicking, instead you need to carefully mark them with mouse drag.

And after making many changes, you can not undo them with Ctrl+Z because you need to completely reset Meta Editor. So you just lost a version with a bug to a chaotic version that you can't turn back.

Does somebody know if there is a version where this problem doesn't persist? To be honest I hope it will be fixed at some point.

Thanks in advance.

Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Symbol Properties
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Symbol Properties
  • www.mql5.com
Symbol Properties - Environment State - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 

Bump.
 
pennyhunter #:
Bump.

Don't do that please.

The problem you reported is known, deal with it for now until it's, maybe, fixed.

 
pennyhunter:

And after making many changes, you can not undo them with Ctrl+Z because you need to completely reset Meta Editor. So you just lost a version with a bug to a chaotic version that you can't turn back.

Use git to manage your code, many times in my job I had to rollback patches that either introduced a bug or simply did not work.

 
pennyhunter:

Hi everybody. Each time that I have an array out of bounds error in some MQL5 program while debugging with variable observation, Debugger won't react. Then I can only close it and usually the EA/Indi that I was testing has to be reopened. Asides from that the variables that I picked for observation in debugger are all gone. While with normal variables this doesn't seem like such a big problem, it can be very tedious work when working with a structure because you can't mark the thing by double clicking, instead you need to carefully mark them with mouse drag.

And after making many changes, you can not undo them with Ctrl+Z because you need to completely reset Meta Editor. So you just lost a version with a bug to a chaotic version that you can't turn back.

Does somebody know if there is a version where this problem doesn't persist? To be honest I hope it will be fixed at some point.

Thanks in advance.

Simply solve your problem by if (IS_DEBUG_MODE && i>=ArraySize(..)) DebugBreak();

 
Carl Schreiber #:

Simply solve your problem by if (IS_DEBUG_MODE && i>=ArraySize(..)) DebugBreak();

By definition when you have a bug in your code, it's when you forgot to do this. In such case MetaEditor is crashing, the OP is right. It's not "his" problem, it's a MetaEditor bug, it should never crash. And it's not related to just "array out or range" but to any critical error.

 

Okay thank you for your comments. And sorry for bumping.

It seems there is a very easy solution for the first problem: Just save the EA/Indi file with the specified observation variables. It couldn't be easier and it does exist.

 
pennyhunter #:

Okay thank you for your comments. And sorry for bumping.

It seems there is a very easy solution for the first problem: Just save the EA/Indi file with the specified observation variables. It couldn't be easier and it does exist.

Edit: It seems it doesn't do the trick if you simply save, but you have to quit and restart Meta Editor after saving. I guess the observation variables are only then stored in some preset log or something.

 
pennyhunter #:

Edit: It seems it doesn't do the trick if you simply save, but you have to quit and restart Meta Editor after saving. I guess the observation variables are only then stored in some preset log or something.

Nice, they seem to have fixed it. Thank you Meta Quotes.
Reason: