Re: Labeled parameters
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.