I am reading in a standard csv file. I have managed to figure out how to point at certain row numbers. But what happens if you don't know how many records are in the file. There is no end of file marker in my data. I have tried to use while loops but I can't get anything to work successfully. There must be a simple way of doing it that I have missed.
Here is my code (pointing at row 2 of the file):
Code: Select all
if CurrentBar = 1 then Begin
ListC_ID = ListC.new;
Value1 = ListC.ReadFile(ListC_ID,Filename);
//virtual column names
Date_ID = ListC.Get(ListC_ID,1);
Time_ID = ListC.Get(ListC_ID,2);
Strategy_ID = ListC.Get(ListC_ID,3);
MP_ID = ListC.Get(ListC_ID,7);
mContracts_ID = ListC.Get(ListC_ID,8);
//read rows
Date_ = ListS.Get(Date_ID,2 );
Time_ = ListS.Get(Time_ID,2 );
Strategy_ = ListS.Get(Strategy_ID,2 );
MP_ = ListS.Get(MP_ID,2 );
mContracts_ = ListS.Get(mContracts_ID,2 );
Print("Date_=",Date_," | Time_=",Time_," | MP_=",MP_," | mContracts_=",mContracts_);
ListC.Clear(ListC_ID);
END;