MQL4 - automated forex trading   /  

Documentation

MQL4 Reference  File functions  FileReadInteger

 
Use the opportunities of
MQL5 in MetaTrader 5
Study the new MQL5 language
Study the new MQL5 language.
Reference is already available
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);
    }