Re: Scope
Re: Scope
- Subject: Re: Scope
- From: Paul Skinner <email@hidden>
- Date: Sun, 15 Dec 2002 10:34:15 -0500
Paul B,
I'm glad that you solved your problem and I'm sorry if you felt I was
being obtuse or critical.
I'm developing a project that will handle hundreds of handlers for
multiple scripts and this problem seems to be pertinent. I also have an
error handler that gathers data from within subroutines and returns
them to the user.
I tried very hard to follow this thread, I tried creating each of the
variations of all of the posted scripts, I tried various versions of
scripts for script 'B' before you posted anything defining it. I tried
analyzing what I thought you were trying to do. I failed.
When I couldn't follow the thread I asked you to post a simpler
version. This is just the way that I go about finding bugs. Unnecessary
parts of the script get chucked until there's nothing but essential
code left.
I feel like you might have taken my request as an insult. Your reply
seems a bit angry. I hope I can make it clear that I understand your
frustration and the difficulty involved in presenting a problem clearly
that you don't fully understand. If it was easy to present, then you'd
probably have resolved it long ago.
On Saturday, December 14, 2002, at 05:21 PM, I wrote:
>
All the non-crucial variables, comments as to what would
>
happen in some other non-posted script and anecdotal evidence are just
>
camouflage.
When I wrote this I was referring to the loop, the unused Var
variables, and even to the code that loaded scripts B and C. Even
though loading scripts is necessary in your final code, here it
obsfucates the problem and makes for more difficult testing. You could
place all these scripts within explicit script blocks in one window and
test the same effect as loading them. If this isn't true then that is
helpful information too. (I can't test this due to the fact that the
code works for me regardless.)
On Saturday, December 14, 2002, at 05:21 PM, I wrote:
>
As a design question, I'd ask why you don't just pass all the
>
pertinent values to all the handlers in their parameters. A list,
>
perhaps
On Saturday, December 14, 2002, at 05:37 PM, Paul Berkowitz wrote:
>
I explained why not in the last message. If and when there is a
>
run-time error due to corrupt data in one of the applications being
>
scripted, the error is caught by a general error trap that relays a
>
lot of pertinent information to the user in a text file. The error
>
handler needs to be able to access a lot of accumulating, stored
>
property values, some of which aren't being dealt with by the current
>
handlers. Many of the routines will pass through about 40 handlers:
>
there are about 100 handlers all told in the two scripts. I can't be
>
passing 35 parameters in every handler - 33 of them probably unused in
>
the current routine - just to avoid using properties: that's stupid.
I understood that before you explained it so clearly to me : )
I was thinking that a list of all the values needed by the error
handler could be built at the top of the main script and then passed as
reference to the handlers that may need to pass it to the error
handling routine. Not optimal, but seeing as I couldn't even see the
error I wanted to explore other alternatives.
On Saturday, December 14, 2002, at 10:23 PM, Paul Berkowitz wrote:
>
OK, I seem to have got it fixed. As I suspected I needed to access the
>
unused variable before returning it. Simply doing this:
snip
>
This does not happen with short scripts such as the ones I've been
>
using as examples. It does not even happen for every user: for some
>
reason it was not happening to me OMM, although the just-previous
>
version did fail that way. All the users (so far) who had the strange
>
error yesterday report back that my newest version returning 'my var3'
>
works fine; no errors any more.
snip
>
I'm sorry that the problem is so complicated, and the scripts so long,
>
that
>
it was hard to explain it clearly here.
I hope I'm not pushing my luck or your buttons when I ask if you can
post a script that Will produce the error reliably now?
--
Paul Skinner
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
- Follow-Ups:
- Re: Scope
- From: Paul Berkowitz <email@hidden>
- Re: Scope
- From: Paul Berkowitz <email@hidden>
- Re: Scope
- From: Paul Berkowitz <email@hidden>
References: | |
| >Re: Scope (From: Paul Berkowitz <email@hidden>) |