Page 1 of 1
search within DCBROWSE
Posted: Fri Dec 22, 2017 9:34 am
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
Re: search within DCBROWSE
Posted: Fri Dec 22, 2017 10:17 am
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()