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.











Related Topics:
What is VTS
System Requirements
Installing VTS
Main Menu
Toolbox FUNCTIONS Pane
Expert Advisor Facts
Configure
PLATFORM Function
Custom Indicators
TRADETIME Manager
COMMUNICATION Manager
Message
Logic
Options
MetaTrader Platform Configuration
Compiler
Compiler Flags
Platform
Editor
EA Output Folder
Custom Indicator Folder
Package
fnOpenOrder
fnModifyOrder
fnCloseOrder
Getting Started
MetaTrader Platform
Journal Tab
Experts Tab
Expert Menu
MQL Help
Trade Tab
ECN Brokers
Logic
Candlestick Function Parameters
Candlestick Drawing
Using Easy Email with the fnSendEzEmail Function
Testing the Easy Email Connection
Objects on the MetaTrader platform
Manually drawing a trend line
Removing a trend line
Building an Expert Advisor to draw and manage a trend line
Script & Multi-Platform Plug-in
Building a MetaTrader Script
Using the Multi-Platform Feature
Client-Side Stops Plug-in
Emergency Stops
Using Client-Side Stops
Objects on the MetaTrader Platform
Manually Drawing a Fibonacci Retracement
Removing a Fibonacci Retracement
Building an Expert Advisor to draw and manage a Fibonacci retracement
Signal Type: Element
Signal Type: Logic Condition
Using the Code Block Feature
EA-Indicator Price Chart
EA-Indicator Video
Chart Objects Plug-in
fnDrawHorizontalLine
fnDrawVerticalLine
fnDrawArrow
fnDrawThumb
fnDrawLabel
fnDrawText
fnDrawCheckSign
fnDrawStopSign
Chart Objects on a MetaTrader Price chart
Adding Symbols
EA Secure Configuration
Chart Execute Plug-in
Chart Execute Configuration
Chart Execute on Price Chart
Using Chart Execute
Chart Execute Notes
Pivot Points on a MetaTrader Price Chart
fnFileWrite
fnDeleteFile
Multi Trade on a MetaTrader Price Chart
Using the Debug Manager Plug-in
MQL Event Documentation