PreviousNextIndex

QUERY-OFF-END function

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
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 Customer.CustNum Customer.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 the AVM exits the loop.

Note

To test whether a GET statement read beyond the last (or first) record, you can use the AVAILABLE function with the buffer name. You can also use the QUERY-OFF-END function, which 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, QUERY-OFF-END attribute, REPOSITION statement


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex