Ok - here is what I have but can't quite get it to work.
I have the code to fget and the code that I want to replace.
How do I put a loop inside the "New Method" to fget to read the csv file in 
place of each "OR" I have in the "Old Method"?

****New Method****
_SECTION_BEGIN("ReadingCSV");
Title = "Reading CSV";
fh = fopen("C:\\AmiBroker CSV\\ABTest.csv","r");
if (fh)
{
while(!feof(fh))
   { 
Numbers = fgets( fh ); // What I need to do is use this list to slim down the 
IndustryID to be used
//IndustryID() == Numbers; // This might work, but how to implement ?
   } 
}
else 
{ 
   printf("ERROR: file can not be found (does not exist)");
}
fclose(fh);
_SECTION_END();


**** Old method ****
if ( RIDon == 1 ) // RIDon is restrict to these Industrys
    Filter = Filter AND ( 
                 IndustryID() == 2
                 OR IndustryID() == 3
                 OR IndustryID() == 4
                 OR IndustryID() == 5
                 OR IndustryID() == 7
                 OR IndustryID() == 15
                        );

> > Does anyone have simple snippet of code that takes a csv file (could be
> > comma delimited or carrage returned) that then can be the input for going
> > through a list.
> >
> > Example: text.csv contains a list of numbers that would be used to
> > "restrict" or "slim down" the IndustryID that is being used for a "display"
> > or "explore".
> >
> > Thanks
> >

Reply via email to