Why mql4 is reading this backwards? File operations
| The order the Alert parameters are created is not specified. Try: | string A=FileReadString(handle); string B=FileReadString(handle); Alert("Fecha= ",A,"Percentaje= ",B); |
Normally a csv file is organised in rows (lines ended by \n) and delimiters like ';'
I read those files by (without testing, without error checking)
int hdl = FileOpen(FileName,FILE_READ|FILE_CSV|FILE_COMMON); uint sz = FileSize(hdl); string s = FileReadString(hdl,sz), l[]/*line array*/,c[]/*column array*/; int nl = StringSplit(strFile,'\n',l), nc; // no lines and no. columns while(nl-->0) { // => last line first nc = StringSplit(l[nl],';',c), nc; while (nc-->0) { // last column first string col = c[nc]; ... } }
Im kinda shock, maybe anyone of you could help me.
I dont understand why this returns me the columns changed order. I have an CSV with 2columms full of data. And this returns me A2,A1; B2;B1; etc....
why??