Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Correlated subquery thanks
Message
De
22/03/2021 10:35:00
 
 
À
22/03/2021 07:14:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01679124
Message ID:
01679222
Vues:
29
I have been going through a transition on the logical fields as well. I never used to include the logical .T. or .F. in the code but over time thought that if anyone else had to maintain the code, it would not be so obvious (especially if a non-VFPer I suppose).

This now indeed makes more sense:
IF <logicalfield> = .T.
but so does this, what I have done since the beginning of (VFP) time:
IF NOT <logicalfield>
but it seems now inconsistent although it does definitely "read faster" when I am reading code - sticking the "NOT" in front of the logical field "reads" exactly like it should to me.

As for the "!", I have just about never used it for the same reason you state - just too easy to miss it. I sometimes use it in a long ICASE statement to save room on the line so the line does not have to wrap.

Albert

>
>For logical fields, I'm partial to just using the field name (for .T.) or NOT the fieldname (for .F.). That's true for me everywhere, not just in SQL. While there's no speed difference, I find I'm really likely to misread (logicalfield = .F.) and I'll never misread (NOT logicalfield). I also feel strongly about using NOT rather than !, because it's too easy to miss the exclamation point.
>
>Tamar
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform