Re: Can someone please explain (Language Guide)
Re: Can someone please explain (Language Guide)
- Subject: Re: Can someone please explain (Language Guide)
- From: Axel Luttgens <email@hidden>
- Date: Thu, 10 Jan 2008 13:27:42 +0100
On 10/01/08 11:47, Skeeve wrote:
Axel Luttgens wrote:
Not really useful in this case, but should give the idea:
on getItem of ThisList at Pos
return item Pos of ThisList
end getItem
getItem of {"a", "b", "c"} at 2
--> "b"
Okay... You've put an "of" there. But if I read it correctly, "of" and
"in" should be optional. It's written as
[ of | in ]
and not
( of | in )
like it is done with the
( on | to )
which is not optional for defining a handler
What I wanted to create is a handler:
on the_last weekdayname for a_date
so that I can write
the_last Monday for current date
Aha, you were thinking at that one...
IIRC, it never worked to write user-defined handlers with a direct
parameter but without that "of" or "in" preposition (unless in very,
very early versions of AS?).
I guess it would have led to too many ambiguities.
But AppleScript's syntax allows such constructs for non user-defined
commands, so that the ASLG still mentions the fact (not very clearly, I
agree).
HTH,
xel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden