• 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: How to use delimiters in Standard Additions file read/write commands?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to use delimiters in Standard Additions file read/write commands?


  • Subject: Re: How to use delimiters in Standard Additions file read/write commands?
  • From: Devon and Cornwall <email@hidden>
  • Date: Sun, 18 Mar 2001 16:41:46 -0800

At 9:37 AM -0800 3/18/01, Devon and Cornwall wrote:

>set thefile to choose file
>set filRef to open for access thefile
>set thelist to read filRef using delimiter {" "}
>close access filRef
>thelist
>
>or (a little faster)
>
>set thefile to choose file
>set filRef to open for access thefile
>set thelist to words of (read filRef)
>close access filRef
>thelist

The second construction is NOT faster. In fact, it takes twice the
time of the first!

Also, while on the subject, changing the line in #1 to read:

set thelist to read filRef as list using delimiter {" "}

returns an array, rather than a simple list, and cuts the
speed in half!

{{"If"}, {"this"}, {"next"}, {"AppleScript"}, {"wasn't"}, {"so"}, {"much"}, {"fun"}}

Devon and Cornwall


  • Follow-Ups:
    • Re: How to use delimiters in Standard Additions file read/write commands?
      • From: Bill Briggs <email@hidden>
References: 
 >How to use delimiters in Standard Additions file read/write commands? (From: Charles Arthur <email@hidden>)
 >Re: How to use delimiters in Standard Additions file read/write commands? (From: Devon and Cornwall <email@hidden>)

  • Prev by Date: Re: How to use delimiters in Standard Additions file read/write commands?
  • Next by Date: Re: PICTs and Dialog Director
  • Previous by thread: Re: How to use delimiters in Standard Additions file read/write commands?
  • Next by thread: Re: How to use delimiters in Standard Additions file read/write commands?
  • Index(es):
    • Date
    • Thread