Re: startlog() messages
Posted in 1994
> We have a set of programmes that call startlog(filename) at the start.
> This is to track Informix errors, that users are not bothered to less us
> know.
> > The problem is that sometimes the info in the logfile is not
> comprehensive
> enough. It does not tell which executable it came from.
> > eg :
> > Date: 14-10-94 Time: 17:03:41
> Program error at "nextnum.4gl", line number 43.
> SQL statement error number -244.
> Could not do a physical-order read to fetch next row.
> SYSTEM error number -107.
> ISAM error: record is locked.> > Unfortunately "nextnum.4gl: is a function called by various
executables.
> > Other examples which are virtually useless :
> > Date: 11/10/1994 Time: 02:15:43
> FORMS statement error number -1332.
> A character variable has referenced subscripts that are out of
range. > > Date: 11-10-94 Time: 14:07:47
> FORMS statement error number -1218.
> String to date conversion error
> > 2) If a deadlock occurs, is it possible to determine which 2
executables
> are responsible ? One of them is displayed in the logfile, but is there
> a way to find out who it is competing with ?
> > Any experts with advice ?
> -----------------------------------------
> Ti Lian Hwang
> Email : tilh@sin-co.sin-ro.dhl.com
> -----------------------------------------
You'd have to make a call to errorlog(string_var) with your own custom
message.
For example:
MAIN
LET prog_id = "myprog"
...
...
END MAIN
FUNCTION error_func()
LET err_msg = "Error occurred in program ",prog_id CLIPPED
CALL errorlog(err_msg)
...
...
END FUNCTION
The existing message will still get written to the log.
Another point that comes out of this is that you're usually better off
using WHENEVER ERROR CONTINUE and having a graceful error handling
function, than letting the program crash out every time you get an error.
In the case of your first example (lock contention), you'd probably want
to give the user the option to try again and return control to the
program.
Don't forget you need the WHENEVER ERROR... statement just before the
first executable statement in each **.4gl MODULE**, 'cos it's a compiler
directive, not an executable statement.
akent@cix.compulink.co.uk (Andy Kent)
-------------------------------------