Progress
Programming
Handbook


Error Handling

Each method of the query object, buffer object, and buffer-field object that can have errors returns a value of type LOGICAL that you can test. If an error occurs, the method returns FALSE, but does not automatically raise the error condition. Progress Software Corporation (PSC) recommends that you test the return value of methods like QUERY–PREPARE, where an error causes subsequent OPENs, GET–NEXTs, etc. to fail.

The following code fragments demonstrates checking the return value after the QUERY–PREPARE method:

DEFINE VARIABLE retval AS LOGICAL.
retval = q:QUERY-PREPARE("FOR EACH customer...").
IF retval = FALSE THEN.../* error exit */ 

The following code fragment demonstrates checking the return value after the QUERY–OPEN method:

DEFINE VARIABLE retval AS LOGICAL.
retval = q:QUERY-OPEN().
IF retval = FALSE, THEN.../* error exit */ 


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