[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] AppleEvent - AEPrint Q.



At 15.44 -0700 1999.08.05, Rob Sirota wrote:
>This is probably a very basic question...
>
>after executing my appleevent I can print the reply with:
>print AEPrint($rep), "\n"; and get
>aevt\ansr{errn:9}
>
>is there a way to get only the errn:9? I need to check if an error
>was returned.

Well, you can $errn = AEGetParamDesc($rep, 'errn'), then $errn->get.  Or
you can just use a regex to get the result from the AEPrint (though that is
not necessarily a good way).  Remember to dispose $rep and $errn.

Mac::AppleEvents::Simple does some stuff with errn and errs.  If you do this:

  $evt = do_event(qw/fooo barr bazz/, $form, @params);

Or:

  $evt = build_event( ... );
  $event->send_event;

Then errn is put into $^E for you:

  die $^E if $^E;

It is also returned in $evt->{ERRNO}.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org