Kbase 15197: How to override default search in Browse
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
How to override default search in Browse
In Version 7.3 and later, the browse search is one character deep.
For example, if you type a "b" the browse will reposition to the first
record that begins with "b". If you type an "l" immediately after "b",
the browse will look for the first record starting with "l" instead of
"bl".
The following code lets you override this default search mode. Then,
when you type "bl", the browse will reposition to the record
starting with "Blue" (sports.db).
1) In UIB Section Editor, go to Definition section. Define
variables as below:
def var r as recid.
def var x as char.
2) Create an ON ANY-PRINTABLE trigger for the browse and insert
the following code:
x = x + chr(lastkey).
find first customer where customer.name begins x no-error.
if available customer then do:
r = recid(customer).
reposition browse-1 to recid r.
end.
3) Create a ON RETURN trigger that allows you to refresh the search:
x = "".
reposition browse-1 to row 1. /* This line is optional*/
Progress Software Technical Support Note # 15197