Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The m. variable thing, the sequel
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Database:
Visual FoxPro
Divers
Thread ID:
00969478
Message ID:
00977416
Vues:
108
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform