• 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: has's list wrappers [Re: Passing *possible* variables to a handler]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >has's list wrappers [Re: Passing *possible* variables to a handler] (From: Nigel Garvey <email@hidden>)

  • Prev by Date: Re: "choose from list"
  • Next by Date: Re: url access
  • Previous by thread: has's list wrappers [Re: Passing *possible* variables to a handler]
  • Next by thread: Delete file
  • Index(es):
    • Date
    • Thread