Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The m. variable thing, the sequel
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00969478
Message ID:
00977416
Views:
100
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform