Can an indicator buffer array[] not be of type "int"?

 

If I do this in an indicator, the array gets populated with correct values:


double buffer1[];


buffer11[i]=somecomputedvalue();



If I do this, the array gets populated with garbage values:



int buffer1[];


buffer1[i]=somecomputedvalue();



It doesn't seem to matter if I apply MathRound etc or not in the second case.

 

See function SetIndexBuffer():

bool SetIndexBuffer(

int index, double array[])

Binds the array variable declared at a global level to the custom indicator pre-defined buffer. The amount of buffers needed to calculate the indicator is set with the IndicatorBuffers() function and cannot exceed 8. If it succeeds, TRUE will be returned, otherwise, it will be FALSE. To get the extended information about the error, one has to call the GetLastError() function.

 

double buffer can accept integer value on assignment, like 1 = 1.0000, 2 = 2.0000 etc.

double indicatorBuffer[];



start(){

   for(..., ..., ...){

      int someValue = whatever;

      indicatorBuffer[i] = whatever;



 

Well, I just have to get used to such "features" of the language. If the construct is illegal, then it may be a better option to spit it out at compile or run-time rather than populate it with unpredictable values.


On the plus side, there are many positive features so I'm not complaining.