search and highlight

egeerdink

New Member
Hi,
I have a program that displays temp table information in a browse window. This window can have hundreds of lines and I'd like to modify the program so that once I display everything in the browse window I can then search for a specific item. when it finds that item I'd like that row to be highlighted. any ideas how to do this?

OE 10.1BSP3

Thanks.
 

rzr

Member
How will you want to search for a specific item?

Once the search criteria is entered to select the data from temp-table / browse, you can FIND the record from the TEMP-TABLE that matches the selection criteria. The use the methods & attribtues for a BROWSE widget to find and highlight that selected record.

You may want to use the following methods:
ROWID()
FETCH-SELECTED-ROW()
IS-ROW-SELECTED()
SELECT-FOCUSED-ROW()
 

egeerdink

New Member
To test this all out I'm creating a simple program that puts two fields of a table (item.item and item.description) into a temp table and then displays it in a browse. Then, I want to use a fill-in to search for a specific item in that temp table. When I click go, I would like to have that specific item highlighted in the browse.
I'm looking up the methods you suggested and am learning as much as I can, but further help with examples would be appreciated.

Thanks again.
 

GregTomkins

Active Member
I have worked with like a million P4GL browses and have never done this ... mostly because our browses almost always load incrementally with total possible results (rows) in the billions, which makes searching them in a reliable way pretty tough. Anyway:

Browses have a START-SEARCH event which you might find helpful, BUT, to the best of my knowledge it is up to you to implement all of the logic ... eg., prompting for a search term, then scanning the TT for matches, then highlighting the row(s). The last of these operations would probably be the most tedious to get to work correctly, because you have to worry about (eg.) the possibility that the matching term is somewhere scrolled off the currently visible area. Also, you have to decide how and when to clear the highlighting (eg. when the search term changes). You also need to consider whether you will support partial matches, matches within (vs. at the beginning of) a string, and wildcards. For example, should '*FOO??' return 'BARFOOBA'? These are simple problems, though.

HTH.
 

4GLNewbie

Member
i think you can manage to obtain that..

i hope you have defined a query "for scrolling" and the browse is based on temp-table fields

you need to process an event on the button, then do your query on temp-table with the appropriate filter
even you have finded the row, you must tell the browse

above i think there are all the functions you may have to use

do you think you can manage to obtain that or need more help?
 
Top