#113022 - 2004-02-03 10:19 AM
Re: "On Error" function or sub
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Quote:
Ultimately, it comes back down to 'sloppy coding'
No it doesn't, and simply repeating the statement doesn't make it true.
The point is that there are things that will happen that are beyond your control and which you cannot reasonably script for.
You do not perceive a need because I guess you have not had the experience of function calls returning illegal data which cause problems that you cannot be expected to deal with.
How often do you check in your scripts that UBound() is returning a valid integer before you use it. Never? Well of course you don't - you quite reasonably expect the return value to be as it is documented in the manual.
But what happens when Ubound() returns a garbage string instead? A subtle bug which has been dormant, corrupt DLL, memory error - all these sort of things can cause an error.
Is it sloppy coding because you haven't trapped it? No, it's an unexpected error which you cannot reasonably be expected to code for.
As a simpler example, how do you deal with stack overflows, out of memory errors and the like? You cannot script for them.
Having a catch-all to deal with abends is a nice-to-have. It is by no means a major omission in KiXtart, and there are techniques that can be used to get a near equivalent.
Far from being sloppy coding, having some sort of exception reporting is good technique.
|
Top
|
|
|
|
Moderator: Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart
|
0 registered
and 581 anonymous users online.
|
|
|