[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: XPL is smarter than we are



** Reply to message from Harry Binswanger  on Tue, 04 Jan 2005
00:01:28 -0500

Error detection using VA$ER
---------------------------

FWIW, you don't (really) ever *reset* VA$ER. A successful command doesn't
change it. So you might think, well, let's grab VA$ER before a procedure, and
then again after a procedure; and if it hasn't changed, then no error occurred.

The flaw in that analysis is, what if the procedure _did_ incur an error, but
it coincidentally bears the same VA$ER number as the preexisting VA$ER number?
Such coincidences are by no means infrequent, in routines that repeatedly do
the same or related things. So a better idea is to deliberately incur an error
that simply canNOT be triggered by the upcoming procedure. BX Q2 (no command,
VA$ER=11) is very commonly used because it is the most succinct error-trigger
available. If you want a real oddball, try BX mdQ2 , which sets VA$ER=95
("Specify mode"). Then you run your routine, and if VBA$ER is still 95 on
termination, nothing untoward happened.

Be aware, however, that there are many real errors that do not trigger a change
in VA$ER status.

-----------------------------
Robert Holmgren
holmgren@xxxxxxxx
-----------------------------