• 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: Olof Hellman <email@hidden>
  • Date: Mon, 22 Apr 2002 13:22:48 -0700

> 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.

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

- Olof
_______________________________________________
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: Number of Decimal Places
  • Next by Date: Re: MacOS: Making 6,000 barcodes
  • Previous by thread: Deafult or optional arguments to handlers
  • Next by thread: Re: Deafult or optional arguments to handlers
  • Index(es):
    • Date
    • Thread