Alain Verleyen: Just noticed this bug is still present in MT5 Build 2190. I will report it.
Hi, I noticed that FileReadString has still a limitation (MT5 Build 2622). Writing a string to .bin seems without limitation. But when I try to read a bin file with 16384 characters, then it won't read the string. (File with 16383 characters works).
intOnInit()
{
//---string str1=readBinFile("16383.bin");
string str2=readBinFile("16384.bin");
Print("StringLength 16383.bin: ",StringLen(str1),"\n",
"StringLength 16384.bin: ",StringLen(str2));
//---return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+string readBinFile(conststring fName)
{
int filehandle = FileOpen(fName,FILE_READ|FILE_SHARE_READ|FILE_BIN|FILE_COMMON);
if (filehandle == INVALID_HANDLE)
{
Alert(fName," FileOpen in COMMON FAILED: ",_LastError); FileClose(filehandle);
}
string f = FileReadString(filehandle,(int)FileSize(filehandle));
FileClose(filehandle);
return(f);
output:
Is that a bug, or an actual limitation for some reason?
Just noticed this bug is still present in MT5 Build 2190. I will report it.
Hi, I noticed that FileReadString has still a limitation (MT5 Build 2622). Writing a string to .bin seems without limitation. But when I try to read a bin file with 16384 characters, then it won't read the string. (File with 16383 characters works).
output:

Is that a bug, or an actual limitation for some reason?
Thanks for any help in advance.
Cheers, Julian.