Re: How to tell if a report was started
Posted in 2006
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Versions, Editions & End-of-Life
On 18 Dec 2006 15:40:16 -0800, kimmerkc <kkohler@peapod.com> wrote: > I have a 4GL (7.13) app that makes use of several different reports 7.31? AFAIK, there never was an I4GL 7.13. There was an IDS 7.13, but you should *not* be using it still - and that has been true for a decade or so. > based on various circumstances in the data. The application has a > general error function that is accessed via "WHENEVER ERROR CALL > error_function" at the start of the MAIN body of the app. I would like > this error function to handle cleanup of open reports so that a retry > attempt or the next data record or whatever can proceed to reuse the > reports. > > So, in my error function, is there a way to tell which reports have > been started? Or to call "FINISH REPORT" on each possible report > without the app blowing up when it encounters one that was never > started? The report started if STATUS = 0 after the 'START REPORT' statement. If you want to do clever error handling, use WHENEVER ERROR CONTINUE and test the status after the START REPORT statement. You could look up TERMINATE REPORT. You will probably need to code a structure to record which reports are open, and arrange to finish or terminate reports depending on which are open. You could just close them all - arranging to ignore errors from unopened reports. > Other than creating global variables (ick) to keep track of each > report, I haven't come up with a solution. I tried wrapping the FINISH > statements in: > WHENEVER ERROR CONTINUE > FINISH REPORT a > FINISH REPORT b > ... > WHENEVER ERROR CALL error_function > > This did not seem to work, as I saw an error on the screen about a > report having not been started, but I am still working on manufacturing > an error "properly" to test. Hmmmm; I seem to remember there are some untrappable errors - and maybe not starting a report is one of them. That'd take some poking around on my part to discover which ones they are. No; I'm not volunteering (sorry). -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/ -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/
Jonathan Leffler wrote: > On 18 Dec 2006 15:40:16 -0800, kimmerkc <kkohler@peapod.com> wrote: > > I have a 4GL (7.13) app that makes use of several different reports > > 7.31? AFAIK, there never was an I4GL 7.13. There was an IDS 7.13, > but you should *not* be using it still - and that has been true for a > decade or so. > Yes, 7.31 - typo, sorry. Kimberly
Related threads
- the longer you surf, the MORE $$$ you earn !!
- Store procedure
- emulation for Vt100
- extent size questions again ...