string FileReadString(
int file_handle, // File handle
int length=-1 // Length of the string
);
...
When reading from a bin-file. the length of a string to read must be specified.
When reading from a txt-file the string length is not required,
and the string will be read from the current position to the line feed character "\r\n".
When reading from a csv-file, the string length isn't required also,
the string will be read from the current position till the nearest delimiter
or till the text string end character.
Ok, now I want to read my file in the whole and I write:
int handle, szFile, noLines;
string strFile, arrFile[];
handle = FileOpen(fName, FILE_SHARE_READ | FILE_READ | FILE_BIN);
szFile = FileSize(handle);
strFile = FileReadString(handle, szFile);
noLines = StringSplit(strFile,"\n",arrFile);
Print("My File with 20 lines and 2k has now ",noLines," Line?? FileSize: ",szFile);
I get:
2014.03.20 15:09:42.509 test EURUSD,M1: My File with 20 lines and 2k has now 1 Line?? FileSize: 2048
Is that intended?
Beside that I would appreciate if the variable types of FileSize (ulong) and the length (int) to read would match:
ulongFileSize(
int file_handle // File handle
);
..
intFileWriteString(
int file_handle, // File handleconststring text_string, // string to writeint length=-1// number of symbols
);
You may set as default (read all or do not use) the max of ulong?
This I read in the reference:
Ok, now I want to read my file in the whole and I write:
Is that intended?
Beside that I would appreciate if the variable types of FileSize (ulong) and the length (int) to read would match:
You may set as default (read all or do not use) the max of ulong?