Re: has's list wrappers [Re: Passing *possible* variables to a handler]
Re: has's list wrappers [Re: Passing *possible* variables to a handler]
- Subject: Re: has's list wrappers [Re: Passing *possible* variables to a handler]
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 14 Jul 2002 20:25:59 -0700
On 7/14/02 7:02 PM, "Nigel Garvey" <email@hidden>
wrote:
>
on wrapList(theList)
>
if theList's class is not list then error "Not a list."
>
script
>
property p : theList
>
end script
>
>
return a reference to the result's p
>
end wrapList
>
>
This actually works inside a handler. Access to specific items of the
>
wrappedList is then possible via normal AppleScript syntax and is even
>
faster than with your "methods". You'd have to use the 'contents'
>
operator to signify or compare the list itself, but that wouldn't
>
normally be a great inconvenience.
>
>
set wrappedList to wrapList({"a", "b", "c", "d", "e"})
>
set wrappedList's first item to 9
>
wrappedList's contents
>
--> {9, "b", "c", "d", "e"}
>
>
{"Hello"} & wrappedList
>
--> {"Hello", 9, "b", "c", "d", "e"}
>
>
wrappedList as string
>
--> {"Hello", 9, "b", "c", "d", "e"}
Eh?
Actually, and correctly:
"9bcde"
--
Paul Berkowitz
_______________________________________________
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.