General information
Category:
Coding, syntax & commands
Environment versions
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.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only