Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Iif(lExp, .t., .f.)?
Message
De
24/01/2010 17:30:01
 
 
À
23/01/2010 15:56:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01445223
Message ID:
01445742
Vues:
120
>>>>>>It reads, "I've no clue what logical expressions are".
>>>>>>"IF THIS VALUE IS FALSE" would be
>>>>>>
>>>>>>IF NOT THIS.VALUE
>>>>>>
>>>>>>>Example:
IF THIS.VALUE = .F.
reads as IF THIS VALUE IS FALSE.
>>>>>
>>>>>I've seen this every place I've worked on code. It drives me nuts, but I've actually had other developers change my IF !this.value to IF this.value = .F. so I've learned to live with it :o) I don't sweat the small stuff.
>>>>
>>>>And I won't use ! for NOT. I find it's too hard to see. I always spell out NOT>
>>>>
>>>>Tamar
>>>
>>>I must be weird then; Always loved simplicity ;
>>>
>>>
>>>If !ok
>>>  return   && .t. 
>>>
>>
>>My problem with that code is that I have to look too hard to see whether it's IF !ok or IF lok.
>>
>>Tamar
>
>Hmmm. When I see NOT in place of !, I tend to wonder if the writer is lacking a deeper understanding of the aspects of the programming language. No need to spell out NOT when ! will work just fine.
>
>:o) Just couldn't resist. I'm ok with:
>
>IF ! LLOkay
>
>IF NOT LLOkay
>
>IF LLOkay = .F.
>
>IF LLOKay = .T.
>
>IF LLOkay
>
>All work. To me, which format is used is more user preference than anything else. I prefer ! LLOkay, but over the years I've had to decipher code written in all formats. I've had folks change my choice which is a pet peeve when it does nothing to the behavior, but hey, that's life :o)

FWIW, I work with lots of other people's code, and I rarely change any of this. I only do so when I'm actively working with a piece of code and it's impeding progress or when I know that a particular way of doing things is inefficient or risky (like using a macro for a file name).

Tamar
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform