At 12:21 29.01.2002 +0100, Cornelius wrote:
>I have a bunch of prefs as key/value pairs in an external file
>some of the values are lists, rects, etc.
>
>I need to get these back as their original types. They are all strings
>however.
>
>Anyway to do this?
>
The value() function may be of help here:
put value("rect(86, 445, 748, 600)")
-- rect(86, 445, 748, 600)
put value("rect(86, 445, 748, 600)").ilk
-- #rect
This works with lists, proplists, even nested lists:
dLp =["NumEB": 0, "ModulDone": [0, 0, 0, 0, 0], "ModulVisited": [1, 0, 0,
0, 0], "TestOk": 0]
str = string(dLp)
put value(Str).ilk
-- #propList
Be warned: nested quotes and void as a value inside a list may cause
trouble so I would recommend to test the results before using them
best regards
daniel plaenitz
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/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!]