• 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: Reading and writing records
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading and writing records


  • Subject: Re: Reading and writing records
  • From: has <email@hidden>
  • Date: Fri, 24 Aug 2007 16:35:48 +0100

Chris wrote:

I know how to read and write a list of records to a file using the "as
list" qualifier.
[...]
Does anyone have a code snippet for writing a list of records one at a time and reading them back one at a time until eof?

You don't. You slurp the whole list into memory and work on it there. (This is not to say it's impossible, just a very bad idea.)


A more useful question would be: what are you trying to achieve (i.e. what's the script's purpose)? e.g. If you're needing a persistent, filesystem-based data store that allows random access, then using Standard Additions to read and write serialised AppleScript data structures is really the wrong tool for the job and there are much more appropriate solutions that you should look into (plain text files, XMLLib.osax, System Events' Plist Suite, Database Events, FileMaker Pro, PostgreSQL, etc.).

HTH

has
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: Reading and writing records
      • From: Chris <email@hidden>
  • Prev by Date: Re: Problem installing ImageMagick
  • Next by Date: Re: Reading and writing records
  • Previous by thread: Re: Reading and writing records
  • Next by thread: Re: Reading and writing records
  • Index(es):
    • Date
    • Thread