CArrayDouble usage with iMAOnArray command

 

Hi,

I'm using an CArrayDouble object to store some "double" values and I what to be able to use iMAOnArray on them but the compiler is complaining about a "parameter conversion not allowed" error.

Could someone tell me how I get the values from the CArrayDouble object ready for use with the iMAOnArray command please?

 Maybe I need to use a template but I've never used them or perhaps ArrayCopy or, in my view, a nasty for next loop into a dynamic array (yuk).

 Thanks in advance for you help! 

 
imamushroom:

Hi,

I'm using an CArrayDouble object to store some "double" values and I what to be able to use iMAOnArray on them but the compiler is complaining about a "parameter conversion not allowed" error.

Could someone tell me how I get the values from the CArrayDouble object ready for use with the iMAOnArray command please?

 Maybe I need to use a template but I've never used them or perhaps ArrayCopy or, in my view, a nasty for next loop into a dynamic array (yuk).

 Thanks in advance for you help! 

You can't do that easily unless you know OOP. iMAOnArray() needs an array of double type as parameter, but CArrayDouble object don't provide a way to access the internal data array.

So you will need to build your own class inheriting from CArrayDouble and add a method to access the data array.

 
Alain Verleyen:

You can't do that easily unless you know OOP. iMAOnArray() needs an array of double type as parameter, but CArrayDouble object don't provide a way to access the internal data array.

So you will need to build your own class inheriting from CArrayDouble and add a method to access the data array.

Thanks.

 

That's what I was worried about and had just started to write such an inhertitance. Could take me a while as I need to understand the CArray internals. heyho!!

 Thanks again for your response.