找回密码
 立即注册

MQL4>MQL5:文件函数

2024-5-1 21:12| 发布者: admin| 查看: 219| 评论: 0|来自: 文章来源MQL5官网

摘要: 文章来源MQL5官网
 
MQL4
 MQL5 说明
void FileClose(int handle)
void FileClose(int file_handle)
FileClose
关闭先前通过 FileOpen() 函数打开的文件。
FileClose
void FileDelete(string filename)
bool FileDelete(string file_name
                int common_flag=0)
FileDelete
删除指定文件名。
FileDelete
void FileFlush(int handle)
void FileFlush(int file_handle)
FileFlush
将存储在文件缓存中的所有数据刷新到磁盘。
FileFlush
bool FileIsEnding(int handle)
bool FileIsEnding(int file_handle)
FileIsEnding
如果文件指针处于文件末尾,则返回逻辑 true,否则返回 false。
FileIsEnding
bool FileIsLineEnding(int handle)
bool FileIsLineEnding(int file_handle)
FileIsLineEnding
对于 CSV 文件,如果文件指针在行的末尾,则返回逻辑 true,否则返回 false。
FileIsLineEnding
int FileOpen(string filename,
             int mode,
             int delimiter=';')
int FileOpen(string ile_name,
             int pen_flags,
             short delimiter='\t'
             uint codepage=CP_ACP)
FileOpen
打开用于输入和/或输出的文件。返回打开文件的文件句柄,失败时则返回 -1。
FileOpen
int FileOpenHistory(string filename,
                    int mode,
                    int delimiter=';')
-FileOpenHistory
打开当前历史记录目录 (terminal_directory\history\server_name) 或其子文件夹中的文件。返回打开文件的文件句柄。如果函数失败,返回值为 -1。
int FileReadArray(int handle,
                  object &array[],
                  int start,
                  int count)
uint FileReadArray(int file_handle,
                   void array[],
                   int start_item=0,
                   int items_count=WHOLE_ARRAY)
FileReadArray
将指定数量的元素从二进制文件读入数组。
FileReadArray
double FileReadDouble(int handle,
                      int size=DOUBLE_VALUE)
double FileReadDoubleMQL4(int handle,
                          int size=DOUBLE_VALUE)
  {
   return(FileReadDouble(handle));
  }
FileReadDouble
从当前二进制文件位置读取具有浮点的双精度数字。
FileReadDouble
int FileReadInteger(int handle,
                    int size=LONG_VALUE)
int FileReadInteger(int file_handle,
                    int size=INT_VALUE)
FileReadInteger
从当前二进制文件位置读取整数。
FileReadInteger
double FileReadNumber(int handle)
double FileReadNumber(int file_handle)
FileReadNumber
从当前文件位置读取分隔符前的数字。仅适用于 CSV 文件。
FileReadNumber
string FileReadString(int handle,
                      int length=0)
string FileReadString(int file_handle,
                      int size=-1)
FileReadString
函数从当前文件位置读取一个字符串。
FileReadString
bool FileSeek(int handle,
              int offset,
              int origin)
bool FileSeekMQL4(long handle,
                  int offset,
                  ENUM_FILE_POSITION origin)
  {
   FileSeek(handle,offset,origin);
   return(true);
  }
FileSeek
函数将文件指针从开头、末尾或当前文件位置移动一个新位置,偏移量以字节为单位。
FileSeek
int FileSize(int handle)
ulong FileSize(int file_handle)
FileSize
函数以字节为单位返回文件大小。
FileSize
int FileTell(int handle)
ulong FileTell(int file_handle)
FileTell
返回文件指针的当前位置。
FileTell
int FileWrite(int handle,...)
uint FileWrite(int file_handle,...)
FileWrite
函数用于将数据写入一个 CSV 文件,自动插入分隔符。
FileWrite
int FileWriteArray(int handle,
                   object array[],
                   int start,
                   int count)
int FileWriteArray(int file_handle,
                   void array[],
                   int start_item=0,
                   int items_count=WHOLE_ARRAY)
FileWriteArray
函数将数组写入一个二进制文件。
FileWriteArray
int FileWriteDouble(int handle,
                    double value,
                    int size=DOUBLE_VALUE)
uint FileWriteDouble(int file_handle,
                     double dvalue)
FileWriteDouble
函数将一个具有浮点的双精度值写入一个二进制文件。
FileWriteDouble
int FileWriteInteger(int handle,
                     int value,
                     int size=LONG_VALUE)
uint FileWriteInteger(int file_handle,
                      int ivalue,
                      int size=INT_VALUE)
FileWriteInteger
函数将整数值写入一个二进制文件。
FileWriteInteger
int FileWriteString(int handle,
                    string value,
                    int size)
uint FileWriteString(int file_handle,
                     string svalue,
                     int size=-1)
FileWriteString
函数从当前文件位置将字符串写入一个二进制文件。
FileWriteString

路过

雷人

握手

鲜花

鸡蛋

QQ|Archiver|小黑屋|www.mtctp.com |

GMT+8, 2024-10-22 16:43 , Processed in 0.032202 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

返回顶部