Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is it okay to name a function True()
Message
De
17/02/2006 07:25:10
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 6 SP5
Database:
Firebird
Divers
Thread ID:
01097002
Message ID:
01097012
Vues:
13
>IF True(x) = .F.

It's never necessary to compare against .T. or .F.
IF X && is exactly the same as IF X=.T. 
IF NOT X && is exactly the same as IF X=.F. 
>>Hi all
>>
>>I have just created a function True(). I do not think this is a reserved word in VFP but I am also using FireBird as the backend, in fact I had to create this function to handle a small int used as a boolean field in VFP.
>>
>>Please let me know should I rename it to _True() so something that is more compatible with VFP. The function goes as follows:
>>
>>
FUNCTION True(luValue)
>>	RETURN (NOT ISNULL(luValue)) AND (luValue = 1)
>>ENDIF
>>
>>
>>Please advise.
>
>You might want to call it IsTrue() instead, to reflect what it is doing. Also having a function called True() will mean strange statements like
>
>IF True(x) = .F.
> blah de blah
>ENDIF
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform