C#, Visual Studio 2008, Windows Forms
I want to initialize an array (don't care whether it is a struct or a class or arraylist or whatever).
Here is an example of a couple of data records I would like to stuff into the array:
Record/Item 1: foo1(), "Descriptio n 1", 0.99, true
Record/Item 2: foo2(), "Descriptio n 2", -1.45, false
Record/Item 3: foo1(), "Descriptio n 3", -1.00, null
so the types I am dealing with are function, string, double, bool.
I would like to structure it so that to enter new records by simply typing (into the source code directly!) lines like:
{ foo1, "Descriptio n 1", 0.99, true },
{ foo2, "Descriptio n 2", -1.45, false },
{ foo1, "Descriptio n 3", -1.00, null},
etc for about 200 records, which gives me a nice visual 'table' that I can scan, modify, add to or delete from easily.
What I do NOT want is something like:
x.a = foo1;
x.b = "Descriptio n 1";
x.c = 0.99;
x.d = true;
where the records in the code are vertically aligned, and hard to read and edit.
I've struggled quite a bit trying to find a 'wrapper' that will use the format described above but always seem to end up in a dead end.
Any help would be appreciated.
Thanks.
I want to initialize an array (don't care whether it is a struct or a class or arraylist or whatever).
Here is an example of a couple of data records I would like to stuff into the array:
Record/Item 1: foo1(), "Descriptio n 1", 0.99, true
Record/Item 2: foo2(), "Descriptio n 2", -1.45, false
Record/Item 3: foo1(), "Descriptio n 3", -1.00, null
so the types I am dealing with are function, string, double, bool.
I would like to structure it so that to enter new records by simply typing (into the source code directly!) lines like:
{ foo1, "Descriptio n 1", 0.99, true },
{ foo2, "Descriptio n 2", -1.45, false },
{ foo1, "Descriptio n 3", -1.00, null},
etc for about 200 records, which gives me a nice visual 'table' that I can scan, modify, add to or delete from easily.
What I do NOT want is something like:
x.a = foo1;
x.b = "Descriptio n 1";
x.c = 0.99;
x.d = true;
where the records in the code are vertically aligned, and hard to read and edit.
I've struggled quite a bit trying to find a 'wrapper' that will use the format described above but always seem to end up in a dead end.
Any help would be appreciated.
Thanks.
Comment