Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Building a WHERE clause
Message
 
À
11/12/1998 14:34:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00166558
Message ID:
00166713
Vues:
19
OK, here's what I just came up with. I know there is some slop in it, but it seems to work OK. Let me know what you think.

lcWhere = ""
lnElements = 4
DIMENSION laFilter[lnElements]

laFilter[1] = "1"
laFilter[2] = "2"
laFilter[3] = "3"
laFilter[4] = ""

lcWhere = ""
llAnother = .F.

FOR lnCurrent = lnElements to 1 STEP -1
IF !EMPTY(laFilter[lnCurrent])
FOR lnNext = lnCurrent to 1 STEP -1
IF !EMPTY(laFilter[lnCurrent])
llAnother = .T.
ENDIF
NEXT
IF llAnother
laFilter[lnCurrent] = " AND " + laFilter[lnCurrent]
llAnother = .F.
ENDIF
ENDIF
lcWhere = lcWhere + laFilter[lnCurrent]
NEXT
IF LEFT[lcWhere,4] = " AND"
lcWhere = RIGHT(lcWhere,LEN(lcWhere)-4)
ENDIF

?"Where: " +lcWhere
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform