Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Big Problem with simple code
Message
De
07/09/2005 09:44:50
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01047265
Message ID:
01047323
Vues:
8
>Thanks for the quick response.
>
>Simply searching and replace '=' with '==' everywhere is safe?
>
>I still don't understand what caused it to start doing what it's doing.

The explanation can be found in the help topic SET EXACT.

Basically, a comparison like:
? "abc" = "ab"
will, by default, only compare the first two characters, because that is the size of the second expression - so the result will be true.

Sometimes this is useful, especially when there are spaces at the end:
seek "Bates"
which also requires a comparison, will work even if the field length happens to be more than 5 characters.

And sometimes, this feature can cause you trouble.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform