Re: True Optional Handler Parameters (Positional)
Re: True Optional Handler Parameters (Positional)
- Subject: Re: True Optional Handler Parameters (Positional)
- From: Michael Terry <email@hidden>
- Date: Sun, 22 Feb 2004 18:09:48 -0800
On Feb 22, 2004, at 5:31 PM, Paul Berkowitz wrote:
Then you might have stumbled across the following, inspiring a sliver
of hope:
showArgs("jello","brand","gelatin")
--> j
--> e
--> l
--> l
--> o
Oops, again, but at least there wasn't an error. How to get the other
arguments? After beating your head against the wall for a few minutes
(or hours, if you're like me), you gave up that approach as a loss.
Why don't you just do:
on showArgs(args)
repeat with i in args
display dialog i
end repeat
end showArgs
showArgs({"jello", "brand", "gelatin"})
The 'repeat with i in ...' syntax requires a list. So just give it a
list
and keep it happy.
No kidding? So that's what I've been doing wrong all this time. And
here I thought I was making another point entirely.
As you can see in the text you quoted, I passed a list[1], but you can
access only the first item passed. I could've spent more time
explaining exactly what I was getting at, but there's a size limit on
messages to the list.
Now, if you read all the way to the bottom, you may find something more
interesting than whether or not I know the difference between a string
and a list.
Mike
[1] English list for sure, and sometimes an AppleScript list--read the
whole post. Sorry it's so long.
_______________________________________________
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.