search within DCBROWSE

This forum is for eXpress++ general support.
Post Reply
Message
Author
ampandya
Posts: 58
Joined: Tue Apr 19, 2016 4:48 am

search within DCBROWSE

#1 Post by ampandya »

Hi
Can i create a search button to find all the records with the searched word in any of the 3 fields and filter only those?

Many thanks
Ankit

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: search within DCBROWSE

#2 Post by rdonnay »

You would use an array of record numbers and DC_SetScopeArray() to set the scope of the work area.

Code: Select all

cSearch := 'ALASKA'
aFilter := {}
cAlias := Alias()
(cAlias)->(dbGoTop())

DO WHILE !(cAlias)->(Eof())
  IF cSearch $ Upper((cAlias)->city) .OR. cSearch $ Upper((cAlias)->name) .OR. cSearch $ Upper((cAlias)->notes
    AAdd( aFilter, (cAlias)->(RecNo()) )
  ENDIF
  (cAlias)->(dbSkip())
ENDDO

(cAlias)->(DC_SetScopeArray(aFilter))
(cAlias)->(DC_DbGoTop())

oBrowse:refreshAll()
The eXpress train is coming - and it has more cars.

Post Reply