Strange broker error

 

I get the error 1 parameter for ArraySize function must be an array with a particular broker. How could this be explained?

double _V[],_value;
if(ArraySize(_V)>0) { Print(" V value:.. ",_value," V first:.. ",_V[0]," V last:..",_V[ArraySize(_V)-1],
      " V max:..",_V[ArrayMaximum(_V,WHOLE_ARRAY,0)]," V min:...",_V[ArrayMinimum(_V,WHOLE_ARRAY,0)]); }
         
         if(ArraySize(_V)<_session) { ArrayResize(_V,ArraySize(_V)+1); }
	//Function to increment _V with 'value'
         //StartBuffer(_value,_V,ArraySize(_V));
         
         
         if(ArraySize(_V)>0) { if((_V[0]-_V[ArrayMinimum(_V,WHOLE_ARRAY,0)])/_V[0]<_rating) { Print(" value:.. ",
                            (_V[0]-_V[ArrayMinimum(_V,WHOLE_ARRAY,0)])/_V[0]," is below rating... ",_rating); return; }}
         
         if(ArraySize(_V)==0) { return; }
 
BHC:

I get the error 1 parameter for ArraySize function must be an array with a particular broker. How could this be explained?

Have you ArrayResize() the array before you used ArraySize() on it ? what build of MT4 are you using ?
 
RaptorUK:
Have you ArrayResize() the array before you used ArraySize() on it ? what build of MT4 are you using ?


No I had not tried to resize first.

I am compiling with build 509.

 
RaptorUK:
Have you ArrayResize() the array before you used ArraySize() on it ? what build of MT4 are you using ?


Resizing before does not help
 
BHC:

Resizing before does not help
OK, there should be no problem with build 509, I think you need to show more of your code . . . I can't see the cause of the error . . .
 
RaptorUK:
OK, there should be no problem with build 509, I think you need to show more of your code . . . I can't see the cause of the error . . .


I got this to work. I had called the ArraySize function with a variable that was not an array at some other point in my code. Thanks for the help any way.
Reason: