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: Arthur J Knapp <email@hidden>
- Date: Wed, 01 Aug 2001 09:40:11 -0400
>
Date: Tue, 31 Jul 2001 22:46:12 -0700
>
Subject: Re: Read/Write 'as short' and 'write "" starting at'
>
From: Christopher Nebel <email@hidden>
>
On Tuesday, July 31, 2001, at 09:49 AM, Paul Berkowitz wrote:
>
> 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.
Right, I remembered the raw syntax +class shor;, which compiled
as "small integer".
>
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.
Good stuff. :)
Have have a number of handlers that assume the current file
position is just before a relevant piece of data. I'm glad to
know that "read ... for 0" works.
>
... 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.
;-) You don't know me very well, do you ? ;-)
Thanks Chris.
Arthur J. Knapp
http://www.stellarvisions.com
mailto:email@hidden
Hey, check out:
http://www.eremita.demon.co.uk/scripting/applescript/