Error Handler BUG!!
Posted in 1995
From Storm Software: * From uunet.uu.net!rmy.emory.edu!ilist Tue Feb 7 07:19:25 1995 * From: Storm Software <aztec.co.za!storm@uunet.uu.net> * Message-Id: <3h7dim$et5@hermes.is.co.za> * Subject: Error Handler BUG!! * Date: 7 Feb 1995 09:12:54 GMT * Reply-To: aztec.co.za!storm@uunet.uu.net * Organization: Aztec Public Access Internet * Sender: rmy.emory.edu!informix-list-owner@uunet.uu.net * To: rmy.emory.edu!informix-list@uunet.uu.net * X-Informix-List-To: informix-list-in@dssmktg.com * X-Informix-List-Id: <news.11346> * * Here's a good one : * * SCO UNIX 3.2.4 * Informix R4GL V.4.11 UC2 * Informix SE V.5.0 * * We use an error handling function in most of our programs so I was * rather surprised to see one particular error crashing with the * familiar command line suggestions. * * At first I thought it was my error handling routine, but I confirmed * it wasn't by changing the error handler to WHENEVER ERROR CONTINE, * just so I could see the status. * * I then tried the following program to be absolutely sure. * * main * define x smallint * define r_char char(10) * * whenever error continue * let x = 0 * let r_char[x] = "H" * * end main * * I know the program will crash with error -1332, subscripts out of range, * but it is not caught by the whenever error continue. Change r_char * to a smallint or something just to get a different fatal error and it IS * caught by the CONTINUE statement. * * How is this one slipping through? (Jonathan?) * * Me or it? You. If you look in the I-4GL Supplement ( Feb 1992, Part # 000-7171 Rev.A) on page S-180, it states you need the keyword ANY to set status variable after evaluating an expression. So: WHENEVER ANY ERROR CALL your_error_handler ^^^ Robert Minter |Data Systems Support| \\\\\\_/// Programmer, Software Development | Orange, CA | ( _ _ ) rob@dssmktg.com | Tel: 714.771.0454 | (| ^ |) De Colores - Emmaus OC-13 | Fax: 714.771.3028 | \\`-'/ #include <disclaimer.h> SURF'S UP \\_/