Progress
Language Reference
NUM-RESULTS Function
Returns the number of rows currently in the results list of a scrolling query. The results list is initialized when the query is opened. Depending on the query, the entire list is built immediately upon opening or it is gradually as needed.
SYNTAX
query-name
A character-string expression that evaluates to the name of a currently open, scrolling query. If query-name does not resolve to the name of a query, or if the query is not open or not scrolling, then the function returns the unknown value (?).
EXAMPLEThe following example uses the NUM-RESULTS function in a message to report on the number of rows in a browse. Note that the query is opened with the PRESELECT option so that the entire results list is built immediately. Otherwise, NUM-RESULTS might not return the total number of rows in the browse. When you run this procedure and choose a button, Progress selects certain rows within the browse and then reports on the number of rows selected and the total number of rows in the browse.
NOTES
- To use the NUM-RESULTS function with a query, the query must be associated with a browse widget or you must define the query with the SCROLLING option. For more information on query definitions, see the reference entry for the DEFINE QUERY Statement.
- If the query is empty, NUM-RESULTS returns 0.
- When possible, Progress performs optimizations for GET LAST and REPOSITION statements. These optimizations make the results list invalid. At that point, NUM-RESULTS returns the unknown value (?). These optimizations do not occur if the query is opened with the PRESELECT option or has an associated browse widget.
SEE ALSO
CLOSE QUERY Statement, CURRENT-RESULT-ROW Function, DEFINE BROWSE Statement, DEFINE QUERY Statement, GET Statement, OPEN QUERY Statement, QUERY-OFF-END Function, REPOSITION Statement
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |