int FileWriteDouble(int handle, double value, int size=DOUBLE_VALUE)
The function writes a double value with floating point to a binary file.
If the format is specified as FLOAT_VALUE, the value will be written as
a 4-bytes floating point number (of the float type), otherwise, it will
be written in the 8-bytes floating point format (of the double type).
この関数は、double型の浮動小数点数をバイナリ ファイルに書き込みます。形式が FLOAT_VALUE と指定されている場合は、値を 4バイトの浮動小数点数(float型)として書き込みます。それ以外の場合は、8バイトの浮動小数点数(double型)として書き込みます。
Returns the actually written bytes count or a negative value if an error occurs.
エラーが発生した場合は、実際に書き込んだバイト数か、負の値を返します。
To get the detailed error information, one has to call the GetLastError() function. 詳細なエラー情報を取得するには、GetLastError() 関数を呼び出します。
Parameters:
パラメータ:
handle - File handle returned by the FileOpen() function.
FileOpen() 関数によって返されたファイル ハンドル。
value - Double precision value.
倍精度値。
size - Optional format flag. It can be any of the following values:
オプション形式フラグ。値は次のいずれかを指定できます。
DOUBLE_VALUE (8 bytes, default)
DOUBLE_VALUE (8 バイト、規定値)
FLOAT_VALUE (4 bytes).
FLOAT_VALUE (4 バイト)
Sample:
サンプル:
int handle;
double var1=0.345;
handle=FileOpen("mydata.dat", FILE_BIN|FILE_WRITE);
if(handle<1)
{
Print("can't open file error-",GetLastError());
return(0);
}
FileWriteDouble(h1, var1, DOUBLE_VALUE);
//...
FileClose(handle);
|