Re: Checking datatype of CHAR variable in 4GL
Posted in 1998
Well, my assertion of incorrectness springs from essentially two facts: - change in behaviour across versions: WHENEVER ANY ERROR CONTINUE did *not* log conversion errors up to and including (I think) 4.12/6.00. - inconsistency with sql error trapping behaviour: a comparable example would be to prompt the user for a quick sql statement, and PREPARE it with WHENEVER ERROR CONTINUE in effect. in case of error, you are presented with a negative status & SQLCA.SQLCODE, and nothing in the error log. In due time I went through the release notes, and I must say I agree on the fact that back in the old days conversion error log trapping was confusing for the user, however I'm not sure the changes introduced go in the right direction: nowhere in the release notes it is said that the intention was to change the error logging behaviour described in the 4gl ref man, vol 1, chapter 2 (when WHENEVER ERROR CONTINUE is in effect, no error is written to the error log), plus logging conversion errors without specifing their exact location, and without warning the user, now means that I can no longer track down conversion errors - at least in the good old days the user would come to me and say "the computer said this when I was doing that"! On the other hand, it goes by itself that relying on conversion error trapping to check whether a string is made up by integers only is not the best of programming practices - ...practical, maybe, but not orthodox. The sad note, however is that this is not the only minor behavioural change across minor release numbers: for instance PAGE HEADER #1 processing (as opposed to FIRST PAGE HEADER) broke some havoc, over here. Ciao, Marco _______________________________________________________________________________ Marco Greco, Catania, Italy marcog@linux.ctonline.it rem radioterapia +39 95 447828 fax 446558 Informix faq http://www.iiug.org/techinfo/faq/informix.htm 4glworks http://www.ctonline.it/~marcog Informix on Linux http://www.ctonline.it/~marcog/ifmxlinux.htm Alan Denney wrote: > > > From marcog@linux.ctonline.it Sun Feb 15 06:05:50 1998 > > From: Marco Greco <marcog@linux.ctonline.it> > > To: yosemite@netcom.com > > CC: informix-list@iiug.org > > Subject: Re: Checking datatype of CHAR variable in 4GL > > > > That's exactly what I meant, Alan. Form errors (i.e. conversion errors, for > > instance) are logged in the error log even after a WHENEVER ANY ERROR CONTINUE, > > which obviously isn't the correct way of handling errors. > > Well, "correct" is a subjective term here. The "error log" is better > considered a MESSAGE log, and the messages may or may not indicate > actual errors that need attention. The log indicates when negative > STATUS values have been encountered which, depending on program design > and need, may or may not indicate an erroneous condition. > > IMHO, having more info is better than less, since you can choose to ignore > those negative STATUS values that need no action on your part. From your > perspective, perhaps this just gives you more "noise" that causes unnecessary > interrupts. > > I don't know of a solution that satisfies us both here. > > > To make it more clear, this is the contents of my error log after running the > > following useless program (4gl/c 4.16UC2 x SCO 3.2.5.0) > > > > -- > Alan Denney yosemite@netcom.com > > "I do not like this word 'bomb'. It is not a bomb. It is a device which > is exploding." > -- Jacques Le Blanc, French ambassador to New Zealand, referring to the > nuclear 'devices' France is testing in the South Pacific