int FileWrite(int handle, ...)
The function is intended for writing of data into a CSV file, delimiter
being inserted automatically. After writing into the file, the line end
character "\r\n" will be added. Numbers will be converted into
a text at output (see the Print() function).
この関数は、区切記号を自動的に挿入した CSVファイルへのデータ書き込みを対象としています。ファイルの書き込み後に、行終了文字 "\r\n"
が追記されます。数値は出力するとき、テキストに変換されます。(Print() 関数を参照)
Returns the count of written characters or a negative number if an error
occurs.
エラーが発生した場合は、書き込んだ文字数か、負の数を返します。
To get the detailed error information, one has to call the GetLastError() function. 詳細なエラー情報を取得するには、GetLastError() 関数を呼び出します。
Parameters:
パラメータ:
| handle |
- |
FileOpen() 関数によって返されたファイル ハンドル。 |
| ... |
- |
User data to write, separated by commas. It can be up to 63 parameters. コンマで区切られた、書き込むためのユーザーデータ。最大 63個のパラメータを指定できます。
Data of int and double types are automatically converted into a string, but those of color,
datetime and bool typesare not automatically converted and will be written to file as they are (as integers).
int、double型のデータは自動的に文字列に変換されます。しかし、color、datetime、bool型は自動的に変換されず、ファイルへ書き出しの時には整数型になります。
Arrays cannot be passed as a parameter, they can be output elementwise. 配列はパラメータとして渡すことはできません。各要素を出力する必要があります。 |
|
Sample:
サンプル:
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);
}
|