This content has been marked as final. Show 3 replies
There are a number of xtras that will allow you to write text to a text
file. FileIO comes with Director and is free. See the help file for
examples and usage. There are easier ways using other xtras, like
BuddyAPI's baReadIni() and baWriteIni() which allow you to read/write to
an ini file in standard ini format... or propsave or vList to simply
write your list straight to file.
Below is the exact function that will do what you want.
on EXTERNAL_writeData pPath, pData
-- pPath [STR] pass the path including the name of the file
-- pData [STR] the string that you wish to write
pFile = new(xtra "fileio")
if NOT objectP(pFile) then return -1
openFile(pFile, pPath, 2)
writeString(pFile, string(pData)) -- write a null-terminated string to the file
> Below is the exact function that will do what you want.
Except there is no error checking done, and no provision for the case
when the file might already exist