[comp.sys.mac.hypercard] Intercepting error messages

mesard@bbn.com (Wayne Mesard) (05/19/89)

When you try and copy an empty picture (using the Select tool and Copy
Picture) Hypercard gives an error message saying "Nothing to Copy.  Try
Background."  This is fine and dandy, except if you're doing the copying
from within a script (e.g., to move an image from one card to another,
like I'm doing).  In this case, the [possibly-Hypercard neophite] user
is unexpectedly confronted with this messsage.

I think the right thing is for ALL error messages to be handled the way
the "No such card" message is handled by the Go command:

   If a script is being executed then put the message in "the result"
   and keep running (whenever possible).  Otherwise [if it's a menu
   thing or a msg box thing] display it in a dialog box.

Of course this isn't backwards compatible.  So if this behavior were to
be put in a future release, I guess it would have to be contingent on
the value of some global variable, e.g. showErrors.

[Incidently, my solution is to put a single pencil click in the corner
of each card when it gets created.  But that's a hack, and it means that
my script may be doing a lot of work (and wasting a lot of the user's
time) stupidly moving around a blank image.]

If there's some existing way to get around this problem that I've
overlooked, please let me know.


-- 
unsigned *Wayne_Mesard();
MESARD@BBN.COM                       "POKE 144,85"
BBN, Cambridge, MA           

Barry.Chern@f200.n226.z1.FIDONET.ORG (Barry Chern) (05/25/89)

Did you try trapping for the result in your script? Usually, "if the
result is not empty" can be used as a condition tester right after the
command that can possibly fail, followed by instructions for what you want 
done in this eventuality. Or, you can try to go for the more specific, "If 
the result is "Nothing to Copy.  Try
Background.""  Maybe you are saying that you tried this and it doesn't
work in this case. If so, sorry, I haven't tried it , just talking off the 
top of my head.


--  
Barry Chern  via cmhGate - Net 226 fido<=>uucp gateway Col, OH
UUCP:  ...!osu-cis!n8emr!cmhgate!200!Barry.Chern

mesard@bbn.com (Wayne Mesard) (05/26/89)

In article <14642.247BD08B@cmhgate.FIDONET.ORG> Barry.Chern@f200.n226.z1.FIDONET.ORG (Barry Chern) writes:
>Did you try trapping for the result in your script? Usually, "if the
>result is not empty" can be used as a condition tester right after the
>command that can possibly fail, followed by instructions for what you want 
>done in this eventuality.[...]
>Maybe you are saying that you tried this and it doesn't
>work in this case. If so, sorry, I haven't tried it , just talking off the 
>top of my head.

Yes, that is what I was saying.  I want a global like lockErrors which
will direct all error messages to _the result_ as opposed to a dialog
box (where a niave user asks "What's a background?" and then "How come
the program stopped working?".)  Currently, this happens only for some
(one?) errors, and it happens automatically.

-- 
unsigned *Wayne_Mesard();     POKE 59468,16
MESARD@BBN.COM                
BBN, Cambridge, MA           

Barry.Chern@f200.n226.z1.FIDONET.ORG (Barry Chern) (05/27/89)

In addition to the "go" command, you can definitely intercept the result
of "find" commands. But then, I guess you don't get dialogues from those
anyway. Now that I've looked into it a little more, I see that this is a
problem. Hope someone has some suggestions. If you could just cancel the
dialogue from the script, that would be almost as good.


--  
Barry Chern  via cmhGate - Net 226 fido<=>uucp gateway Col, OH
UUCP:  ...!osu-cis!n8emr!cmhgate!200!Barry.Chern