- FileSelectDialog
- FileFindFirst
- FileFindNext
- FileFindClose
- FileIsExist
- FileOpen
- FileClose
- FileCopy
- FileDelete
- FileMove
- FileFlush
- FileGetInteger
- FileIsEnding
- FileIsLineEnding
- FileReadArray
- FileReadBool
- FileReadDatetime
- FileReadDouble
- FileReadFloat
- FileReadInteger
- FileReadLong
- FileReadNumber
- FileReadString
- FileReadStruct
- FileSeek
- FileSize
- FileTell
- FileWrite
- FileWriteArray
- FileWriteDouble
- FileWriteFloat
- FileWriteInteger
- FileWriteLong
- FileWriteString
- FileWriteStruct
- FileLoad
- FileSave
- FolderCreate
- FolderDelete
- FolderClean
FileLoad
Reads all data of a specified binary file into a passed array of numeric types or simple structures. The function allows you to quickly read data of a known type into the appropriate array.
long FileLoad(
|
Parameters
file_name
[in] The name of the file from which data will be read.
buffer
[out] An array of numeric types or simple structures.
common_flag=0
[in] A file flag indicating the operation mode. If the parameter is not specified, the file is searched in the subfolder MQL5\Files (or in <testing_agent_directory>\MQL5\Files in case of testing).
Return Value
The number of elements read or -1 in case of an error.
Note
The FileLoad() function reads from a file the number of bytes multiple of the array element size. Suppose the file size is 10 bytes, and the function reads data into an array of type double (sizeof(double)=8). In this case the function will read only 8 bytes, the remaining 2 bytes at the end of the file will be dropped, and the function FileLoad() will return 1 (1 element read).
Example:
//+------------------------------------------------------------------+
|
See also
Structures and Classes, FileReadArray, FileReadStruct, FileSave