>>>>This is pretty much a classic example of code that should be data driven. Store the values in a table use that for processing. New diagnositic code, new row in table with info to handle processing it. User configurable.
>>>>
>>>>No?
>>>
>>>Yes.
>>>
>>>Unfortunately this is in a project called ReallyOldLegacyCode, fully supported by a great tables like CrappyStructure and CrappierIndexing with fields like NonNormal01, NonNormal02, etc. And that's the really cool stuff. You ought to see the bad side of it...
>>
>>But even in the old legacy code, can't you create a little freetable that hold the diagnosis number and the field name etc and then just reference those in your case statement or processing. Just allows for adding new ones. Anything hardcode will always be a pain.
>
>But I thought that what he has here is already metadata :). Just needed some help making it usable metadata.
But hard coding the case statement limits the number, no matter how you slice it, no? If there is a table and you run a process on every record in the table you can increase the number of 'cases' to whatever you want.
Charles Hankey
Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy
Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.
-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin
Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.