Hi Steve

> Getting the List to string to file works a treat, but getting it back from
> the file and into a list is not so easy.
>
> Here's my code:
>
> scribe = new(xtra "FileIO")
> scribe.openFile(the moviePath & "dictionary.txt", 0)
> rawString = scribe.readFile()
> myList = value(string(rawString))
> put myList
>
> ...at the moment this returns "["
> meanwhile scribe.readFile() returns ""["string"]"" with double quotation
> marks.


Try changing

myList = value(string(rawString))

to

myList = value(rawString)

in effect what you are doing is creating a string of a string and that
appears to perhaps be placing an additional set of quotation marks around
the original string. You shouldn't need to perform the string function on
the result of reading a text file (personal opinion).  The other factor you
might need to look at is what the contents of the file are. See if there is
an additional set of quotation marks in the text file itself, perhaps its
not the read part that is going arry but rather the write part that is
adding the additional quotation marks.

What is your code for writing to the text file? Is there anywhere in that
code that might adding the extra quotes when you write the file ie. if the
write portion is writing the file as "["string"]" then when you read it it
will read back as ""["string"]"".

Not much help but perhaps a few ideas to work with.

Sincerely

Mark

--------------------------------------------
Mark R. Jonkman
Mark R. Jonkman Consulting
ADDRESS: 20 Windermere Crt., Guelph, ON, CANADA N1E 3L4
PHONE: 519-837-8509
EMAIL: [EMAIL PROTECTED]
--------------------------------------------


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to