Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Alltrim strange behavior
Message
 
À
25/04/1999 11:08:55
Christian Cote
Les Logiciels Onoma Inc.
Longueuil, Québec, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00212015
Message ID:
00212026
Vues:
31
Christian,

The others have shown you how to get what you want, let me explain why you are getting what you are.


ALLTRIM(Field) = ALLTRIM(Value)

The alltrims remove all spaces from a value, so if the field is empty it becomes equal to ''. In strong comparison, VFP matches on partials by stopping the comparison as soon as one of the values is exhausted, so with '' on one side (the field is empty) there is a match for any value on the other side.

As an example;
lcVar1 = "Smith"
lcVar2 = "Smi"
lcVar3 = ""
? lcVar1 = lcVar2 && T they are "equal"
? lcVar1 = lcVar3 && T they are "equal"
lcVar4 = "This is a test of a ery long string with alot of stuff in it"
? lcVar4 = lcVar4 && T they are "equal"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform