oops
SELECT COUNT(*) INTO vCount FROM reporttable where &vwhere and limit = 1

________________________________
From: [email protected] [mailto:[email protected]] On Behalf Of Dennis McGrath
Sent: Friday, July 17, 2009 1:48 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: Using the ERROR VARIABLE

John,

In RBDOS this would work, but in RBWIN there is so much going on inside the 
report that I would not depend on it working.
Instead, I would set up a vWhere variable and :

SELECT COUNT(*) FROM reporttable where &vwhere and limit = 1
IF vCount = 0 then
   -- Error message
ELSE
  Print report &vwhere ORDER BY ....
ENDIF

Dennis


________________________________
From: [email protected] [mailto:[email protected]] On Behalf Of John Engwer
Sent: Friday, July 17, 2009 1:33 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Using the ERROR VARIABLE

I have run into a problem when I try to use the error variable to trap errors 
when printing a report.  Here is what my code looks like.

SET ERROR VARIABLE vErrVar
Print report..... where ....  (if the where clause is not satisfied vErrVar 
should change to 2038)
IF vErrVar <> 0 then
   Display message that no items exist....
ENDIF
RETURN

This is used to report the results of a search.  If the operator enters search 
criteria where there is no match the operator should get a message  that the 
search failed.  If error messages are turned on, a 2038, no rows found is 
displayed but vErrVar has a value of 0 instead of the expected 2038.

Does anyone know what I may be doing wrong?

John

Reply via email to