Niklas Nebel wrote:
> Mathias Bauer wrote:
>> But there is another even more important problem:
>> Even if you don't want to create a listener and you just want to call
>> "close(true)" in Basic to make sure that the document will get closed
>> *in case there is no other interested party anymore* you might get an
>> exception that will stop your program though there is no real reason for
>> it. That's the reason that I think that throwing exceptions should be
>> restricted to cases where an error occured, something that *must* be
>> handled by the caller. This is not true in case of failure to close a
>> document because we have means to handle this situation gracefully.
>
> For such simple cases, "on error goto" can be used in Basic.
Correct, so you could do something like
on error goto a
doc.close(True)
on error goto b
but AFAIK basic error handlers don't offer a fine-tuned handling based
on exception types and this leaves the small but non-null probability
that you "caught" a different exception.
Besides that a manipulation like shown above forces the developer to
know the current error handler ("b") prior to his redirection.
Overall I consider the new API means (a locking service) a better tool
for the task.
Ciao,
Mathias
--
Mathias Bauer - OpenOffice.org Application Framework Project Lead
Please reply to the list only, [EMAIL PROTECTED] is a spam sink.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]