Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Comparison != What have I missed?
Message
De
14/12/2012 12:02:34
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Divers
Thread ID:
01559575
Message ID:
01559676
Vues:
47
>
>When you work with ANDs and ORs in one condition you must have brackets ALWAYS.
>
Nope. Just remember operator precedence ;-)
While the bracketed code due to negation IS more readable,
it still has the basic fault of toooooo much code.

>

>m.TheWord3 $ lcTEXT AND ! (m.TheWord3 == m.TheWord1 OR m.TheWord3 == m.TheWord2)
>...
> m.TheWord4 $ lcTEXT AND ! (m.TheWord4 == m.TheWord1 OR m.TheWord4 == m.TheWord2 OR m.TheWord4 == m.TheWord3)
>


All is needed is:
call to function to add to exclusion list [cursor, array, string]
call to scan the table with a check fitting for exclusion list
- seek in cursor
- ascan(,,) in excact mode
- $ in string with special begin/end chars as markers

and the list can merrily grow to many exclusion words without adding a new comparison in each scan.

regards

thomas
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform