MQL4 Reference
File functions
FileReadInteger
| int FileReadInteger( |
int handle, int size=LONG_VALUE) |
The function reads the integer from the current binary file position.
The integer format size can be 1, 2 or 4 bytes.
If the format size is not specified, the system tries to read the 4-bytes value.
To get the detailed error information, one has to call the GetLastError() function.
Parameters:
| handle |
- |
File handle returned by the FileOpen() function. |
| size |
- |
Format size. Can be CHAR_VALUE(1 byte), SHORT_VALUE(2 bytes) or LONG_VALUE(4 bytes). |
Sample:
int handle;
int value;
handle=FileOpen("mydata.dat", FILE_BIN|FILE_READ);
if(handle>0)
{
value=FileReadInteger(h1,2);
FileClose(handle);
}
|
|
|