number of rows in browser v9.1c

KaysarSoze

New Member
Is there any way of finding out the number of rows in a browser widget.
I need to know the total number of rows, as opposed to the number of selected rows.
 

NickA

Member
Results from the query?

Assuming you mean the number of results from the browsers query, then...

Use the NUM-RESULTS function (or attribute if it's dynamic), but... as a FOR EACH browse query initially only grabs a small subset of the results I think you'll need to use PRESELECT - which slows things down.

An alternative would be to open a query of your own before initialising the browse as a PRESELECT using the FIELDS option to return no fields and getting NUM-RESULTS from that. Having no fields returned makes it run quicker, so potentially you'd get better performance than by getting the results from the browse.

AFAIK, there's no ideal solution.

EG
Code:
OPEN QUERY qResults PRESELECT EACH Customer FIELDS NO-LOCK.
MESSAGE NUM-RESULTS ( "qResults" ) VIEW-AS ALERT-BOX INFORMATION.
CLOSE QUERY qResults.
 
If you mean the number of rows shown in the browse widget view port, you may be after the attribute num-iterations.

eg.
Code:
message BROWSE-1:num-iterations view-as alert-box.
 

Serj HAMMER

Junior Racer
num-iterations=1

After You use REPOSITION functions to the last row of the QUERY, You have only one line at the 1st string of BROWSER widget. At this time NUM-ITERATIONS returns 1. I don't know what is possible in such situation. In my application I agree, that it is only one rows. Users press up-down to see more...
 
Top