Fulltext in datawindow
- How-to
- Tomas Beran
- PowerBuilder
- Friday, 29 September 2023 12:41 PM UTC
Hi
I' looking for fulltext search function in datawindow. The idea is something similar to Ctrl+F in Excel.
What I do is:
ls_data = datawindow.data //get full data buffer separated with ~t for cols and ~r~n for rows
ll_found = pos( ls_data, ls_lookFor ) //look for abs. position in the buffer
ll_row = of_countoccurrences(ls_data,"~r~n",ll_found) //calculate the row
//calculate the col in the similar way
...
This solution is quick and mostly working. It doesn't work with dropdowns but it's expected and there are mostly no scenarios where you want search in dropdowns. The main problem is that data can contain tabs or end of lines. It's rare but in this case my solution fails.
I've found a workaround. If I add a dummy column as the last column of the datawindow which such unique value then I can count these values follower with "~r~n". It works well but having a solution which doesn't require additional column would be better.
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.