Re: CATCH command [message #13158] |
Fri, 16 October 1998 00:00 |
steinhh
Messages: 260 Registered: June 1994
|
Senior Member |
|
|
In article <7055u7$3ed$1@nnrp1.dejanews.com> weitkamp@my-dejanews.com writes:
> Why doesn't CATCH catch type conversion errors? It works well with
> other errors, e. g. calls to undefined routines or out-of-range
> subscripts, but has no effect whatsoever on a line like
>
> PRINT, DOUBLE('abc')
Because a type conversion error isn't an *error* that stops
program execution in the absence of a catch statement. The
message issued is only a warning, and the program continues.
> I wonder if this is a bug or a feature. I'm using IDL 5.0 on HP-UX 10.
Feature, I'm afraid. If someone had said at the time of IDL 1.0 (or
some pretty early version) that the statement above *should* have
generated an error (stopping the execution), and gotten RSI to make it
so, it could have been considered a bug now. But AFAIK nobody has
argued strongly in this direction before. I suspect some of the (very
very poorly written!) programs out there are counting on the
conversion of 'abc' (or some other alphanumeric string) to a numerical
zero...
Regards,
Stein Vidar
|
|
|