[26 Apr 2009] Converting special string into a table
Posted: Sat Jun 13, 2020 5:32 pm
Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 26 Apr 2009 14:29:23 +0200
Hi there!
Ok, what I am looking for is an easy way to do the following: I have a string, that has the structure of a table, like
Now, what would be cool and what I need would be this:

This means, is there a way that the content of the string becomes the table? So, if I would write table[1] I would get the value 2? I am not sure, if maybe WriteTable() and ReadTable() could be used for that as a workaround!?
Thanks in advance, Micha
Hi there!
Ok, what I am looking for is an easy way to do the following: I have a string, that has the structure of a table, like
Code: Select all
string$ = "{1, 2, {3 , 4}}"
Code: Select all
table = {}
table = string$
This means, is there a way that the content of the string becomes the table? So, if I would write table[1] I would get the value 2? I am not sure, if maybe WriteTable() and ReadTable() could be used for that as a workaround!?
Thanks in advance, Micha