This content has been marked as final. Show 4 replies
Sigh... once again, I've posted, then found the (obvious) answer.
taking the literal value of the read string so it can be assigned to the list properly. All working now. Hopefully my stupidity will help someone else.
The best solution is to store each item in your list as a separate line
in the text file. This will get you around the list in a string dilemma.
pDetails = ["Forename", "Surname"] -- and so on
totalItems = pDetails.count
repeat with i = 1 to totalItems
myString = myString & pDetails & RETURN
userdets = new (xtra "fileio")
setFilterMask (userdets,"Text Files, *.txt")
filename = userdets.displaySave("Save your details to...",
createfile (userdets, filename)
openfile (userdets, filename, 2)
writeString (userdets, myString)
Then to get your data back, do something like this:
pDetails = userdets.readFile()
tempList = 
totalLines = pDetails.line.count
repeat with n = 1 to totalLines
if value(pDetails.line[n]) = VOID then
pDetails = tempList
Adobe Community Expert
Thanks for taking the time to post that Rob, it'll prove useful.
I've another tricky bit to navigate past coming up but I promise to try harder before posting :)
An alternative is to use the free functions of vList xtra to save to an
external file in native list format. It's much faster than FileIO,
doesn't require 'value()' conversion and can save native Director data