• 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: Labeled parameters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Labeled parameters


  • Subject: Re: Labeled parameters
  • From: John Delacour <email@hidden>
  • Date: Thu, 27 Mar 2003 17:56:58 +0000
  • Mac-eudora-version: 6.0a13

At 10:20 am -0500 27/3/03, Steve Roy wrote:

The following works fine.

sayHi to "Steve"
on sayHi to aUser
display dialog "Hi " & aUser & "!"
end sayHi

But none of the following does.

sayHi to "Steve"
on sayHi aUser
display dialog "Hi " & aUser & "!"
end sayHi

sayHi "Steve"
on sayHi to aUser
display dialog "Hi " & aUser & "!"
end sayHi


So the question is, is my book that old or am I not understanding this right? :)


If you use to in the call you need to use it in the handler. So long as the parameters match, it will work, so either of these will also work:


sayHi("Steve")
--
on sayHi(aUser)
display dialog "Hi " & aUser & "!"
end sayHi

sayHi given aUser:"Steve"
--
on sayHi given aUser:u
display dialog "Hi " & u & "!"
end sayHi


Look in the Language at a Glance hyperstack.

JD
_______________________________________________
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: Making FTP Drop folders?
  • Next by Date: Re: [Newbie] MS Excel GUI and Applescript
  • Previous by thread: Re: Labeled parameters
  • Next by thread: Re: [Newbie] MS Excel GUI and Applescript
  • Index(es):
    • Date
    • Thread