int FileWrite( int handle, …)
该函数的目的是便于书写的数据转换为CSV格式文件,自动插入限定符。在写入文件后,每行的尾端将会添加”\r\n” 符号。数字将会被转变成文本(查看Print() 函数)。
如果生成错误,返回书写字或负值的计数。
获得详细的错误信息,查看GetLastError() 函数。
参量:
handle – 用 FileOpen()函数返回的句柄。
… – 写入的数据,由逗号分离。 它可以是63个参量。当他们作为整数时,int数据和双重类型自动地被转换成串,但不自动转换颜色、日期-时间和bool typesare和写出的文件。数组无法作为参量鼯td>
示例:
int handle;
datetime orderOpen=OrderOpenTime();
handle=FileOpen(“filename”, FILE_CSV|FILE_WRITE, ‘;’);
if(handle>0)
{
FileWrite(handle, Close[0], Open[0], High[0], Low[0], TimeToStr(orderOpen));
FileClose(handle);
}