Download MetaTrader 5

problem in new MQL4

To add comments, please log in or register
Mostafa
16
Mostafa  

hi friends .

i have a problem with new MQL4.... in this version my expert dont work properly... this Error appear : array is out of range...and 4051 error...i have a array in this EA and it worked very good in old MQL4... what can i do ????

whroeder1
14781
whroeder1  
You can FIX the broken program or compile it under the old compiler.
Mostafa
16
Mostafa  
in old compiler everything is ok.but i have problem in new mql4.... :(
Alain Verleyen
Moderator
31185
Alain Verleyen  
2285178:
in old compiler everything is ok.but i have problem in new mql4.... :(

If you can't code, why are you compiling the program with the new mql4 ?

Compile it with the old compiler 509, and copy the .ex4 to the new folder. Otherwise you have to find a way to fix the code.

Mostafa
16
Mostafa  

i haven't problem with comple bro.ok?

my problem is in catching position .... after a while metatrader say that : array out of range ...do u know this error in mql4 ?

whroeder1
14781
whroeder1  
2285178: i haven't problem with comple bro.ok?

Your problem is that you are hard of reading.

The old compiler allowed out of range references and returned zero. The new doesn't.

Asked and previously answered: "You can FIX the broken program or compile it under the old compiler."

Keith Watford
Moderator
9641
Keith Watford  
2285178:

hi friends .

i have a problem with new MQL4.... in this version my expert dont work properly... this Error appear : array is out of range...and 4051 error...i have a array in this EA and it worked very good in old MQL4... what can i do ????


If you have the source file, when you get the array out of range report in the experts tab, it should also include the line and column number, so you can pinpoint the error
Michele Lazzarini
473
Michele Lazzarini  
2285178:

hi friends .

i have a problem with new MQL4.... in this version my expert dont work properly... this Error appear : array is out of range...and 4051 error...i have a array in this EA and it worked very good in old MQL4... what can i do ????

the array index value come out of admitted values > max or < min

find the lines where the array is used and where its index (position) is calculated
and check the values before to assign them

before each line calling the array you can add a:

if (index > max OR index < min) Alert("line XXX");

this is the way to spot the problem

Mostafa
16
Mostafa  
can u make a example for me plz ?
whroeder1
14781
whroeder1  
2285178: can u make a example for me plz ?
We can, can you? learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
To add comments, please log in or register