I'm porting my mq4 program to mq5 and I face compilation issues, not sure what variable expected here as I'm already passing str variable for StringSubst.
const string str=NewsArr[nomf];
string time=StringConcatenate(StringSubstr (str,0,4),".",StringSubstr(str,5,2),".",StringSubstr(str,8,2)," ",StringSubstr(str,11,2),":",StringSubstr(str,14,4));
'StringSubstr' - variable expected
whroeder1: Thanks for your reply! No this is not for indicator, time is just a string array.
I'd initialized as below,
int time1,time2,time3;string time,timeread,timeap;string hour,hour1,hour2;
It does not work when you use it within the StringConcatenate() function
Use it like this instead
Yes it works with StringConcatenate(), but the mql5 version of this function is not the same as mql4.
Yep. My bad ;(
Thanks Mladen Rakic It worked
Yes, but read this post too :
StringConcatenate(time,StringSubstr (str,0,4),".",StringSubstr(str,5,2),".",StringSubstr(str,8,2)," ",StringSubstr(str,11,2),":",StringSubstr(str,14,4));
So it works within string concatenate too (if the first parameter is not omitted and is properly declared as variable)
It depends what form do you like more. I don't like StringConcatenate() (which is obvious:)) and I prefer using the + form (less code and simpler to follow) - but that depends on the style I guess