Join our fan page
- Views:
- 11671
- Rating:
- Published:
- 2008.08.12 08:53
- Updated:
- 2016.03.25 08:26
-
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance
In the "Tools" window of MetaEditor, it is written for the FileOpen function:
Metatraders file functions are limited to the terminals sandbox and its specific folders for files.
And there is no shared-access mode for an open file. At least, it is not given explicitly.
But I would prefer to save files where I want and to read them from where I want. And also to pass data from one operating EA into another operating EA through a file.
I asked on the forum to search in system libraries for how to use file operations in an EA, but nobody seemed being able to do that, although we discussed the SendMessage function from Shell32.dll. Delphi-biased, though.
Well, the functions of file operations are used in the system library of kernel32.dll. It is this library that we import into the EA. The code is attached. Create a file as follows: "C:\Text.txt", save some text in it. Launch the attached script. The script reads the entire contents of the file.
Add some checks for delimiter characters and for line end characters, some cherry syrup - and the ReadLine function is ready...
Note. In the MetaEditor Dictionary, we read: "The length of a string constant ranges from 0 to 255 characters. If the length of a string constant exceed the maximal allowed one, the excessive characters from the right will be cut off, while the compiler shows the following warning:...".
Translated from Russian by MetaQuotes Ltd.
Original code: https://www.mql5.com/ru/code/8314
![MA_Gideon2](https://c.mql5.com/i/code/indicator.png)
Indicator MA_Gideon2.
![DSS Bressert - double smoothed stochastic (Double Smoothed Stochastic Indicator by Walter Bressert)](https://c.mql5.com/i/code/indicator.png)
Indicator of overbuying/overselling