Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Network:
Windows 2000 Server
The code:
lcExact=SET('EXACT')
SET EXACT OFF
LOCATE FOR field1=trim(cField1) and field2=trim(cField2) and field3=trim(cField3);
and field4=trim(cField4) and field5=trim(cField5)
SET EXACT &lcExact
allows for searches that "begins with" the entered text only. I have found that a "contains text" search is broader and allows for partials:
LOCATE FOR ATC(ALLTRIM(cField1),field1)>0 and ;
ATC(ALLTRIM(cField2),field2)>0 and ;
ATC(ALLTRIM(cField3),field3)>0 and ;
ATC(ALLTRIM(cField4),field4)>0 and ;
ATC(ALLTRIM(cField5),field5)>0
To allow for multiple record matches, you can use a SELECT or a SCAN-ENDSCAN (and collect the record pointers to the matches). The and clause above requires all fields to match; if any field match can be a possiblity, then use an or clause.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement