• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Deafult or optional arguments to handlers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Deafult or optional arguments to handlers


  • Subject: Re: Deafult or optional arguments to handlers
  • From: email@hidden (Michael Sullivan)
  • Date: Mon, 22 Apr 2002 17:30:41 -0400
  • Organization: Society for the Incurably Pompous

Olof Hellman writes:

> > In writing a bunch of mods, I'm realizing that I'd really like a way to
> > give clients the opportunity to call a function with optional
> > parameters. Is there any way to do this, other than making the
> > parameter a list or record and then looking through it?
> >
> > I'd like to able to write a function that normally takes a single number
> > argument, but behaves differently if there are two arguments, etc.
> >
> > Is having the client pass a list or record for the multiple parameter
> > option, the only way?
> >
> > Overloading or default arguments would really be a nice feature, don't
> > you think?

> Trivial and elegant if you write a scriptable application. The default
> arguments can also be scriptable.

Can one write a scriptable application in AS, or does this mean writing
elsewhere?

I assume this means parsing the raw apple events for the call? Can one
put in a handler for On <event code>(paramList) or some such?

> In the case of an applet, using a record for the parameters is the best way
> to go.

This is what it seems like for now.


Michael


--
Michael Sullivan
Business Card Express of CT Thermographers to the Trade
Cheshire, CT email@hidden
_______________________________________________
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.

  • Prev by Date: Re: Number of Decimal Places
  • Next by Date: Re: Number of Decimal Places
  • Previous by thread: Re: Deafult or optional arguments to handlers
  • Next by thread: Re: Deafult or optional arguments to handlers
  • Index(es):
    • Date
    • Thread