How to use delimiters in Standard Additions file read/write commands?
How to use delimiters in Standard Additions file read/write commands?
- Subject: How to use delimiters in Standard Additions file read/write commands?
- From: Charles Arthur <email@hidden>
- Date: Sun, 18 Mar 2001 10:40:13 +0000
I'm interested in the file commands of the Standard Additions for reading
(and doing fast TID-based search+replace).
The syntax includes
read: Read data from a file that has been opened for access
read anything -- the reference number, alias, or file
specification of the file to read
[using delimiter anything] -- the value that separates
items to read
[using delimiters list] --
or up to 2 values that
separate items to read
However my script
----
set thefile to choose file
open for access thefile
set theend to get eof of thefile
--display dialog (theend & " bytes") as string -- used in earlier debugging
set thelist to read thefile using delimiter {" "}
close access thefile
----
fails at the "set thelist to..." point with "parameter error".
I've tried having the delimiter as a string, not a list - fails. I've tried
having delimiter "" - fails. All in the same way.
What am I overlooking?
Charles
http://www.ukclimbing.com : 1,000+ British crags, 350+ British climbing walls
- searchable by distance rock type, etc, with 5-day weather forecasts for
every one - plus maps, articles, news, and the New Routes database. There's
even a cool shop attached...