I am trying to read a file into structure, but failed as there was a compilation error. See what I tried:
struct file_row_struct
{
datetime file_time;
string file_range_green;
string file_range_red;
double file_dist_green_red;
double file_slope_green;
double file_slope_red;
string file_prev_color;
string file_current_color;
}filerow[];
int size = 1;
FileReader = FileOpen(file_read_path,FILE_READ|FILE_CSV,',');
if(FileReader != INVALID_HANDLE)
{
//while(!FileIsEnding(FileReader))
// linecount++;
while(!FileIsEnding(FileReader))
{
FileReadStruct(FileReader,filerow,size);
size++;
}
Print("File Opened successfully");
//PrintFormat("File path: %s\\Files\\",TerminalInfoString(TERMINAL_DATA_PATH));
FileClose(FileReader);
}
else Print("Not Successful in opening file: %s ", GetLastError());
The gist of sample file is available at: Sample data
The compilation error that I encountered is as follows:
'filerow' - structures containing objects are not allowed NeuralExpert.mq5 108 36
Kindly, suggest me what I have mistaken. My guess is that there is an availability of the string member function in the structure, hence it is not allowing.