views:

53

answers:

1
enum    ID                           // IDs
    {
    ID_HEADER          = 0,         // ID 0 = headers
    #include "DATA.CSV"
    ID_LIMIT
    };

I inherited some code here.....

Looking at "DATA.CSV" I see all the ID's used to populate the enum in column B, along with other data.

My question:
How does the enum know that it is using "column B" to retrieve it's members? There must be some other logic in the application yet I don't see it. What else should I look for?

Thanks.

+1  A: 

A csv file looks something like this:

foo, bar, zod

so including it expands to:

enum    ID                           // IDs
{
ID_HEADER          = 0,         // ID 0 = headers
foo, bar, zod
ID_LIMIT
};

For this to really work, you would either need a trailing comma in the CSV file, or a comma preceding ID_LIMIT. I don't see where the "column B" you mention in your question comes into it.

anon
Sorry I'm a little bit over-caffeinated I missed that part of your comment. My bad. :)
The Real Diel