I need to pull all the numbers from a CSV file (one number per line - nothing
else in the file) and then use a FOR or WHILE loop to populate the
IndustryID(). This will allow me to choose certain Industrys only as a filter.
I can't quite figure how to make these snippets of code work together.
Thanks
// simple CSV file contains the numbers, one per row, of 2, 3, 4 for test
purposes
//_SECTION_BEGIN("ReadingCSV");
//Title = "Reading CSV";
RIDon = 1; // allows restiction list in CSV file to be used
RID = ""; // RID = restricted IndustryID
fh = fopen("C:\\AmiBroker CSV\\ABTest.csv","r");
if (fh)
{
while(!feof(fh))
{
RID == ( fgets( fh ) );
Filter = Close AND
(IIf(RIDon == 1, IndustryID() == RID, IndustryID() <= 300)
}
}
fclose(fh);
//_SECTION_END();