Because it doesn't work with strings. Furthermore it searches only in the first dimension of an array if it's multidimensional, that would be the first two columns of your array. And it requires the array to be sorted before. It's all written in the spec.
but why if i use for not print nothing o_O, but if insert number work
int start() { string nameFile="forexsymbol.csv"; string terminal_data_path=(TERMINAL_DATA_PATH); string filename="forexsymbol.csv"; // string line_read[2][416]; //assign array of string that will store 2 columns 416 rows of csv data int row=0,col=0; //column and row pointer for the array int handle=FileOpen(filename,FILE_CSV|FILE_READ,";"); //comma delimiter if(handle>0) { while(True) //loop through each cell { string temp = FileReadString(handle); //read csv cell if(FileIsEnding(handle)) break; //FileIsEnding = End of File // Print ("VAVAVAVUBA "+row); line_read[col][row]=temp; //save reading result to array if(FileIsLineEnding(handle)) //FileIsLineEnding = End of Line { col = 0; //reset col = 0 for the next row row++; //next row } else { col++; //next col of the same row } } FileClose(handle); } else { Comment("File "+filename+" not found, the last error is ", GetLastError()); } if(guiIsClicked(hwnd,Button1)) { //Print("I CHE CE DENTRO "+line_read[1][411]); for(int i=0; i<=ArraySize(line_read); i++) { Print("I CHE CE DENTRO- "+line_read[0][i]); } } if(guiIsClicked(hwnd,Button2)) { Print("I CHE CE DENTRO "+line_read[0][411]); } return 0; }
thankz
Please use proper English. This is not Pirate Bay.
but why if i use for not print nothing o_O, but if insert number work
sorry , i ask why , if i use this for
for(int i=0; i<=ArraySize(line_read); i++) { Print("I CHE CE DENTRO- "+line_read[0][i]); }
not print nothing , but if i insert
+line_read[0][411]);
print correct (only one but correct )
ArraySize
The function returns the number of elements of a selected array.
Please look up your array and count the number of elements. You can also Print(ArraySize(line_read)) to see what it returns. Maybe this explains why it prints nothing after a certain value of i.
If you add #property strict to your code you will see a different behaviour. Always use strict when developing mq4.
for(int i=0; i<=((ArraySize(line_read)/2)-1); i++) { Print("I CHE CE DENTRO- "+line_read[0][i]); }
and why with this for not print nothing ?
- www.mql5.com
i have created a 2 dimentional array , string line_read[2][800];
why start a count to 552 ????? if i set a=0 ?????????????
int a=0; for(int i=0; i<=((ArraySize(line_read)/2)-1); i++) { Print("I CHE CE DENTRO- "+line_read[0][a]+a); a++; }
2020.07.19 11:36:01.377 EURUSD,M30: I CHE CE DENTRO- 552
o_O
i try to understand ArraySize , (help book is very short ), if i have 2 dimension array i notice Arraysize return the sum of total of 2 dimension array, but I can't explain myself why in this cicle if i set 417
for(int i=0; i<=417; i++) { Print("I CHE CE DENTRO- "+line_read[0][i]); }
the for instruction work in resoneble manner , but if i use ArraySize the count start to 552 ? o_O
for(int i=0; i<=((ArraySize(line_read)/2)-1); i++) { Print("I CHE CE DENTRO- "+line_read[0][i]); }
anyone can explain me better ArraySize in this specific case ?
thankz at all
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hi guys i try to search in array bidimentional a string but return me error
'ArrayBsearch' - no one of the overloads can be applied to the function call
why ?