Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

large string to list - value() doesn't work - so how

Status
Not open for further replies.

ralph124c41

Programmer
Oct 11, 2004
2
0
0
US
I'm trying to save a list to a file for later retreival back into a list. the only way I've concocked is to save the list as a string, then convert the string back to a list at run time. The only way macromedia provides for converting a string to a list is the value() function. However, it has a limit of 32K characters (or something in that range). I have text files that need to be converted to a list that range 4-20MB. Is there a DB xtra that might do this?? TIA
 
You can write your own simple parser to convert a string taken from external txt file into a List. No need for value() at all.
--
aString = "cat, dog, fish"
gList = []
repeat with i = 1 to aString.word.count
tItem = aString.word
if tItem contains "," then tItem = tItem.char[1..(tItem.length - 1)]
gList.append(tItem)
end repeat

put gList
-- ["cat", "dog", "fish"]
--
20MB of text is a lot, though. As you said, you'd probably better off using a database. There are many database options available such as:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top