Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Building a WHERE clause
Message
De
11/12/1998 10:15:45
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, Royaume Uni
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00166558
Message ID:
00166565
Vues:
12
>Does anyone have a good function/procedure/class that can build n-sized WHERE clauses? That is, I want to be able to pass it something like an array full of populated or empty fields and have it automatically add any needed " AND ". So I could do something like:
>
>lnElements = 4
>DIMENSION laFilter[lnElements]
>
>laFilter[1] = "One"
>laFilter[2] = ""
>laFilter[3] = "Three"
>laFilter[4] = "Four"
>
>oSQL.Where(@laFilter)
>
>?oSQL.WhereClause
>
>One AND Three AND four

Please don't take this as a critcism, but you are looking for a class to replace 3-4 lines of code MAX. If you write it yourself as straightforward in-line code you will save memory and it'll probably execute faster too.
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform