----boundary-LibPST-iamunique-2111234890_-_-
Content-type: text/plain
Gérard & René,
If I might wade in a little on this discussion I have never found error
handling by using a global routine useful simply because the definition
of error is a function of the "context" in which it is found so no
global handler can correctly process it. For example, if I fail to open
an old file is that an error or is it a signal to the program that the
file does not exist and hence one should branch to some other bit of code?
I sometimes program in pure 'boolean' style where every procedure is
either true or false. A 'ladder' like sequence of 'if then else if ...'
results. Procedure P (which may be a test for zero) can then be used in
various contexts where it may be considered a success or failure.
-Doug
Gérard Meunier wrote:
>>Well, Gérard, being a software developer by profession, I'd have to tell
>
> you that n.d. results lead to "trapping" in a lot of languages. There are
> some, like ADA, or PLI, where you can handle errors in an "On Error"
> routine, but usually they tend to make the programs less logical and usable.
>
>>It was one of the very first rules that I learned, to prevent a division
>
> by 0 beforehand.
>
>>I mean, what's the logic behind your question? You can either check for
>
> "division by zero" before you make the division, or your can handle the
> "division by zero" exception afterwards. Where's the big benefit?
>
>>IMHO, not checking for div by 0 is sloppy pogramming, and it is totally
>
> against the logic of Oberon, where you are expressis verbis told that you
> should assert all that is necessary for any procedure etc. before you
> perform it.
>
> Thank you René,
>
> You may be right. Obviously, a program is better if there is no error
> inside. I have to think a little more on this point.
> I'm in a situation where there can be a lot af arithmetic errors, but where
> these errors are harmless: the important points are that the program must
> never stop (no trap) and that the user is warned that an error has occurred
> somewhere and that the result is unreliable. It seemed to me that a
> centralized way of dealing with these errors could be a solution. Of course,
> it may happen that a non harmless error occurrs too and is not trapped. In
> this case, the program could become unstable. So...
> Nevertheless, I think it's impossible to do in BB what I expected.
>
> Regards.
>
> Gérard
>
> --------------------------------------------
>
> To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
> blackbox-request{([at]})nowhere.xy>
> To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.
>
> Send any problem reports or questions related to this email list to the list owner at
> owner-blackbox{([at]})nowhere.xy>
> Current posting policy:
>
> a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.
>
> b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.
>
>
--------------------------------------------
To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
blackbox-request{([at]})nowhere.xy
To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.
Send any problem reports or questions related to this email list to the list owner at
owner-blackbox{([at]})nowhere.xy
Current posting policy:
a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.
b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.
----boundary-LibPST-iamunique-2111234890_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJc
Zm5pbFxmY2hhcnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhcnNldDAgQ291cmllciBO
ZXc7fX0NCntcY29sb3J0YmxccmVkMFxncmVlbjBcYmx1ZTA7XHJlZDBcZ3JlZW4wXGJsdWUyNTU7
fQ0KXHVjMVxwYXJkXHBsYWluXGRlZnRhYjM2MCBcZjBcZnMyMCBHXCdlOXJhcmQgJiBSZW5cJ2U5
LFxwYXINClxwYXINCklmIEkgbWlnaHQgd2FkZSBpbiBhIGxpdHRsZSBvbiB0aGlzIGRpc2N1c3Np
b24gSSBoYXZlIG5ldmVyIGZvdW5kIGVycm9yIFxwYXINCmhhbmRsaW5nIGJ5IHVzaW5nIGEgZ2xv
YmFsIHJvdXRpbmUgdXNlZnVsIHNpbXBseSBiZWNhdXNlIHRoZSBkZWZpb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