>Another programmer introduced me to using DO CASEs like your sample below.
>To me, this code is much more readable than nested IF statements.
>Jim does not like this style.
>
>One thing to point out is that in the sample below, RecordHasChanges()
>and SaveChanges() are not some arbitrary methods.
>If RecordHasChanges() returns .F., your code evaluates the next CASE.
>So I see the entire DO CASE as relating to saving a record, and if saved, ordering the item.
>
>(I also use "m." almost everywhere)!
Andy,
What I'd suggest is a simple SaveChanges() method that determines whether or not the value has changed. IOW, call RecordHasChanged() from within that method.
Second, while VFP's CASE structure is more powerful than other language's, such as BASIC and its variants, or C (and its variants), or even Pascal, it can also be a trap.
It's more powerful in that you can evaluate different functions and variables within the structure. At the same time, however, it presents problems.
You must make sure that the testing hierachy won't inadvertantly miss a valid selection because of the order of the CASE statement.
George
Ubi caritas et amor, deus ibi est