How to write data from double array to a CSV file ?

 

For example, there is a double array as below:

double PriceHighList[100],which contains 100 elements.

Now,I want to transfer the data in this array to a file named PriceHighList.csv,and the date should be saved as one element per line in CSV file.

Which function should be used ?

Is there anyone give an example?

 

define the following line outside init(), deinit() and start():

int Handle;


in the init():

Handle=FileOpen("PriceHighList.csv",FILE_CSV|FILE_WRITE,',');
if(Handle<1)
{
Print("no PriceHighList.csv, error", GetLastError());
return(false);
}


in the start():

for(int i=0;i<100;i++)

{

if(Handle>0)
{
FileWrite(Handle, PriceHighList[i]);
}

}


in the deinit():

if(Handle>0)
{
FileClose(Handle);
}

Reason: