Kevin Altis
Intel Corporation
SuperComputer Systems Division
Beaverton, Oregon
---Scott Raney suggests... >If you don't mind taking a bigger memory hit, an even easier way is: >put shell("cat" && fName) into field "whatever"
-- *** text handlers for MetaCard 1.3Ax
-- note this doesn't return errors, just empty if something goes wrong -- reads text until we reach maxSize -- if maxSize < 1 then we read until we run out of memory, OUCH! -- or end of file (eof) whichever comes first -- Example: -- put importtextfile("prague/readtest.text", -1) into cd fld "flounder" function importTextFile fName, maxSize if fName = empty then answer file "Select text file" if the result = empty then put it into fName else return empty end if set cursor to watch open file fName read from file fName for maxSize close file fName return it end importTextFile
on exportTextFile fName, theBuffer if fName = empty then ask file "Save text as:" with "untitled.txt" if the result = empty then put it into fName else exit exportTextFile end if open file fName write theBuffer to file fName close file fName end exportTextFile