rapidfire Posted August 2, 2015 Report Share Posted August 2, 2015 Hallo,hab bei folgendem Script das Problem, dass nie die letzte Zeile aus dem csv-File ausgelesen wird, obwohl die csv-Datei sogar einen zusätzlichen Zeilenumbruch am Ende hat (der von MT4 beim export autom. erstellt wird) => siehe Datei-Anhang! Hat jemand eine Idee, was ich am Script ändern muss, damit auch die letzte Zeile gelesen wird? string File_Name=Symbol()+".csv"; int Handle = FileOpen(File_Name, FILE_CSV|FILE_READ, ";"); if(Handle<0) { Print(GetLastError()); } while(FileIsEnding(Handle)==false) { i=i+1; string name = FileReadString(Handle); string price2 = FileReadString(Handle); if(FileIsEnding(Handle)==true) break; //--- ENDE VON FILEREAD... double price = StrToDouble(obprice2); ObjectCreate(chart_ID,name,OBJ_HLINE,sub_window,0,price); } FileClose(Handle); WindowRedraw(); Quote Link to comment Share on other sites More sharing options...
rapidfire Posted August 2, 2015 Author Report Share Posted August 2, 2015 hab's inzwischen selbst gelöst: string File_Name=Symbol()+".csv"; int Handle = FileOpen(File_Name, FILE_CSV|FILE_READ, ";"); if(Handle<0) { Print(GetLastError()); } while(FileIsEnding(Handle)==false) { string name = FileReadString(Handle); string price2 = FileReadString(Handle); //--- ENDE VON FILEREAD... double price = StrToDouble(obprice2); ObjectCreate(chart_ID,name,OBJ_HLINE,sub_window,0,price); } FileClose(Handle); WindowRedraw(); 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.