Hi Volker,
> Interesting point.
> thats more the job of logging then of error-messages?
> i played a bit with it, and now there is a prototype
> http://www.reboltech.com/library/scripts/error-logger.r
> on the script-library.
> your function would look like
> displayscreen: func [[catch] p-type /local line-count] [
> mission "displaying screen" [
> switch p-type [
> "A" [Line-Count: Line-Count + 1]
> ]
> ]
> ]
> then and on error logs its mission-goal and the error to %error-log.txt .
> of course you have to customize it ;-)
Interesting reply! Thanks for putting the work in. That's an approach that
solves the problem.
And it gets me wondering if it could be done the other way round. For
example, I define a function called (say) LoggedFunc:
LoggedFunc: func [Params ExecuteBlock] [Implementation]
which I can use as normal:
displayscreen: Loggedfunc [p-type /local line-count] [
switch p-type [
"A" [Line-Count: Line-Count + 1]
]
]
The [Implementation] stacks that "DisplayScreen" has been called, TRYs the
ExecuteBlock as a normal Func, and unstacks the call on 'Return. And, of
course, prints the stack on error.
This would be less "intrusive", and could easily be "turned off" for high
performance (LoggedFunc: :func I think would nix it).
Trouble is I got not idea how to do it. Or rather, I see a some of difficult
problems:
-- How to get the function name as a string?
-- How to pass refinements?
-- How to distinguish LoggedFun's /Locals from my functions locals?
Any help on this would again be greatly appreciated.
Thanks again,
Sunanda.
--
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the
subject, without the quotes.