The function fnReadFile is used to read a single data value from a file. The configuration of the file is defined in the File IO System Manager
Parameter Name |
Data type |
Description |
FileName |
string |
The name of the file to read. MetaTrader will only read files in the MT platform "Files" folder, for example: C:\Program Files (x86)\FXCM MetaTrader 4\MQL4\Files |
Line (number) |
integer |
The line number of the file to read. The special value LAST_LINE always reads the last line of the file. |
ColumnData |
Any data type |
The data column to read, as defined in the File IO Configuration. The selection of the ColumnData parameter determines the data type returned from this function. The values available for selection are determine by the data columns defined in the File IO Configuration. For example, if three data columns are defined as: SymbolName (string) BidPrice (double) AskPrice (double) Those three values will be available for the selection of the ColumnData parameter. If the "SymbolName" value is selected, the function will return a string data type. If the "BidPrice" or "AskPrice" value is selected, the function will return a double data type. The returned data type may be important if the value is used in a comparison statement of a logical condition. |