January 2006
Beginner
592 pages
16h 55m
English
write
write data
Writes data to a file, optionally treating it as a specified datatype; thus you can store any kind of data in a text file and retrieve it later (it will be read correctly if you specify the same class when writing and when reading). There are options for where to start and how much data to write; writing at the end of a file appends, but writing in the middle of the file overwrites existing data (it doesn't insert).
set f to a reference to file ((path to desktop as string) & "justTesting")
open for access f with write permission
write {"Mannie", "Moe", "Jack"} as list to f
close access f
open for access f
set L to read f as list
close access f
L -- {"Mannie", "Moe", "Jack"}Read now
Unlock full access