Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Big Problem with simple code
Message
De
07/09/2005 05:01:19
 
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:
01047280
Vues:
8
>The problem as Mike has pointed out is one of an exact match as opposed to a match. The right-hand expression decides how much is checked. So, 'Domestic Chassis LED' = 'Domestic Chassis' since only the length of 'Domestic Chassis' is checked in the left-hand expression. There are a few different ways to fix this...
>1. Switch the expression around
>2. Use the exactly-equals operator "=="
>3. Set Exact On
>
>A simple demonstration may help illustrate this better...
>
>
SET EXACT OFF
>?'Domestic Chassis LED' = 'Domestic Chassis' && .T. -- only len('Domestic Chassis') is checked to see if it matches
>?'Domestic Chassis' = 'Domestic Chassis LED' && .F.
>
>?'Domestic Chassis LED' == 'Domestic Chassis' && .F.
>?'Domestic Chassis' == 'Domestic Chassis LED' && .F.
>
>SET EXACT ON
>?'Domestic Chassis LED' = 'Domestic Chassis' && .F.
>?'Domestic Chassis' = 'Domestic Chassis LED' && .F.
>
>

Craig, Pardon me,
for completeness:
SET ANSI ON is equal to "=="
but
SET EXACT ON is not eqaul to "=="
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform