Re: Read/Write 'as short' and 'write "" starting at'
Re: Read/Write 'as short' and 'write "" starting at'
- Subject: Re: Read/Write 'as short' and 'write "" starting at'
- From: Christopher Nebel <email@hidden>
- Date: Tue, 31 Jul 2001 22:46:12 -0700
On Tuesday, July 31, 2001, at 09:49 AM, Paul Berkowitz wrote:
I think that both of the Chrises did give us detailed run-downs on this
mailing list of the read/write functionality, including either a couple
of
bugs that remain to be fixed (concerning, I believe, the 'as'
parameter),
when AS 1.6 was released.
Here's a message from Chris Nebel on May 7, 2001, that I kept: ...
Nice to know people save these things! The problems Arthur mentions
were introduced in 1.6, and they both have workarounds.
1. read ... as short
Use "as small integer" instead.
2. 'write "" to f starting at n' to set the file position
Use 'read f from n for 0' instead. This is only slightly slower than
using 'write'. Also, you could use the positioning parameters in the
relevant read or write command, instead of seeking beforehand.
I believe both workarounds work on pre-1.6 systems, but I can't test
that at the moment. I'd also point out that if you're coming back to
read/write after a long absence, read/write as list and as record
actually work now, so there's less need to do your own complex i/o.
--Chris Nebel
AppleScript Engineering