Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form - New Method - Memory Variable Behavior
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00246580
Message ID:
00246675
Vues:
26
>mProduct = "" is Always True when SET EXACT is OFF. Not so when EXACT is ON. Of course empty() is the best solution here.

Ken,

The only true exact comparison of strings is the == operator. Check out the following in the command window;
lcVar1 = "Smith"
lcVar2 = "Smi"

SET EXACT OFF
?lcVar1 = lcVar2 && T
?lcVar2 = lcVar1 && F
?lcVar1 == lcVar2 && F

SET EXACT ON
?lcVar1 = lcVar2 && F
?lcVar2 = lcVar1 && F
?lcVar1 == lcVar2 && F

lcVar2 = "Smith     "
?lcVar1 = lcVar2 && T
?lcVar2 = lcVar1 && T
?lcVar1 == lcVar2 && F
That is because SET EXACT pads teh shroter string with spaces to be equal in length to the longer string before comparing them. == compares them in the usual way (SET EXACT OFF) and then checks their lengths.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform