4gl-error log
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Hi, How can I use Informix 4gl error logs? When I run the 4gl program ,it terminates the application giving forms statement error -1102.How can I trap any error in a program having multiple modules so that the program never gets terminated.Should I use whenever error trap in all the modules?or can I use -anyerror flag? Usha
Usha M Rao wrote: > How can I use Informix 4gl error logs? CALL startlog("/where/you/want/the.log") CALL errorlog("this is the message") ...but you knew that... > When I run the 4gl program ,it terminates the application giving forms > statement error -1102.How can I trap any error in a program having > multiple modules so that the program never gets terminated.Should I use > whenever error trap in all the modules?or can I use -anyerror flag? Compile each module with appropriate WHENEVER ANY ERROR conditions (presumably WHENEVER ANY ERROR CONTINUE to meet your requirements, though I'd never use it myself -- WHENEVER ANY ERROR STOP is more my style, with explicit WHENEVER ANY ERROR CONTINUE statements when I'm prepared to handle a problem). This is a purely compile-time statement, even though you can only ever use where an executable statement can appear. There are still some errors which you cannot trap -- I once had a list and could probably rediscover it if it was going to be of benefit to someone. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v1.00.PC1 -- see http://www.perl.com/CPAN #include <disclaimer.h>
In article <39053B03.AB66286D@earthlink.net>, Jonathan Leffler <jleffler@earthlink.net> writes >Usha M Rao wrote: > >> How can I use Informix 4gl error logs? > >CALL startlog("/where/you/want/the.log") >CALL errorlog("this is the message") > >...but you knew that... > >> When I run the 4gl program ,it terminates the application giving forms >> statement error -1102.How can I trap any error in a program having >> multiple modules so that the program never gets terminated.Should I use >> whenever error trap in all the modules?or can I use -anyerror flag? > >Compile each module with appropriate WHENEVER ANY ERROR >conditions (presumably WHENEVER ANY ERROR CONTINUE to meet >your requirements, though I'd never use it myself -- WHENEVER >ANY ERROR STOP is more my style, with explicit WHENEVER ANY >ERROR CONTINUE statements when I'm prepared to handle a problem). >This is a purely compile-time statement, even though you can >only ever use where an executable statement can appear. > >There are still some errors which you cannot trap -- I once >had a list and could probably rediscover it if it was going >to be of benefit to someone. > > >-- >Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) >Guardian of DBD::Informix v1.00.PC1 -- see http://www.perl.com/CPAN >#include <disclaimer.h> > > We have a standard function called from the MAIN of all programs which starts an error log in a standard place - all our programs use the same error log which we find easier to support. Then each bit of 4GL has 'WHENEVER ERROR CALL do_err' where do_err is a library function which puts the information into the error log with the errorlog() function. We include the date, time & user. However some errors don't seem to get trapped that way. We use RDS and specifically incorrect numbers of arguments passed to or returned from functions still leave the program dropping out. Presumably this is on Jonathan's 'little list'! Also it helps to have plenty of error checking in the code - 'IF sqlca.sqlcode != 0' or after a select a CASE to sort out the NOTFOUND as well as 0 and others. We also have a standard function to pop up a box on the screen if (for example) a cursor cannot be declared. Most useful when developing, and also of great use when errors are reported back to us. -- Surfer!
Related threads
- oninit -s at statup?
- RE: {Spam?} RE: Is Open Office dying?
- IDS 7.31 resize drop and recreate new logical logs
- Re: Error -908 on network connection (IDS 7.30)