Quote:
Okay, I'm not a programming imbecile (though I'm no expert), but are these people really using a loop with a conditional inside the loop to do things in sequence instead of just, well, doing them in sequence?
Yup, amazing isn't it?

I believe the rational in the program I'm maintaining is that there is common code at the bottom of the loop. This is a dumbed down version (the actual method is 3,000+ lines long):

Code:

for (i=0; i<reports.count; i++)
{
switch (i)
{
case 1:
if (checkboxes[1].checked)
r = BuildReport1();
break;
case 2:
if (checkboxes[2].checked)
r = BuildReport2();
break;
..
}
PrepareReport(r);
...
OutputReport(r);
}



For each of the places I put a method call, there is actual code to build each report, prepare it, and output it.

Even with the common code, it's a very brain dead way of doing things, though.
_________________________
-Jeff
Rome did not create a great empire by having meetings; they did it by killing all those who opposed them.