Download MetaTrader 5
To add comments, please log in or register
Traders have already contributed more than 300 articles. Write your own one!
Mostafa
16
Mostafa 2014.02.21 21:25 

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
13641
whroeder1 2014.02.21 21:36  
You can FIX the broken program or compile it under the old compiler.
Mostafa
16
Mostafa 2014.02.21 21:44  
in old compiler everything is ok.but i have problem in new mql4.... :(
Alain Verleyen
Moderator
28651
Alain Verleyen 2014.02.21 21:55  
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 2014.02.21 22:05  

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
13641
whroeder1 2014.02.21 23:20  
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
7981
Keith Watford 2014.02.21 23:55  
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
470
Michele Lazzarini 2014.02.22 12:08  
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 2014.02.24 06:40  
can u make a example for me plz ?
whroeder1
13641
whroeder1 2014.02.24 14:37  
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