Progress
Language Reference


QUERY-OFF-END Function

Interfaces
OS
SpeedScript
All
All
Yes

Returns a logical value indicating whether the specified query is positioned at the end of its result list (either before the first record or after the last record).

SYNTAX

QUERY-OFF-END ( query-name ) 

query-name

A character-string expression that evaluates to the name of a currently open query. If query-name does not resolve to the name of a query, or if the query is not open, then the function returns the unknown value (?).

EXAMPLE

The following example uses the QUERY-OFF-END function to determine when to leave the REPEAT loop.

r-qoff.p
OPEN QUERY cust-query FOR EACH customer.

REPEAT:
   GET NEXT cust-query.
   
   IF QUERY-OFF-END("cust-query")
   THEN LEAVE.
   
   DISPLAY cust-num name.
END. 

When you run this procedure, all customer numbers and names are displayed. After the last record is displayed, the loop iterates and the GET NEXT statement reads beyond the last record. At this point QUERY-OFF-END returns TRUE and Progress exits the loop.

NOTE

To test whether a GET statement read beyond the last (or first) record pass a buffer to the AVAILABLE function. The QUERY-OFF-END function serves the same purpose, but does not require a specific buffer; it requires only a query name.

SEE ALSO

CLOSE QUERY Statement, CURRENT-RESULT-ROW Function, DEFINE BROWSE Statement, DEFINE QUERY Statement, GET Statement, NUM-RESULTS Function, OPEN QUERY Statement, REPOSITION Statement


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095