Dict to String and String to Dict with Visual Works 
Author Message
 Dict to String and String to Dict with Visual Works

Hi,

        I must save object like Dictionary on my SQL/Server.
I want to save a Dictionary (containing all type of object) as string in
a varchar data.
How can i make this? (with de printString method)
And how can I make a Dictionary with this result ?

If it isn't the good email for this question can you tell where can I
send my question.

                                Thank you from Fred



Fri, 23 Apr 1999 03:00:00 GMT  
 Dict to String and String to Dict with Visual Works

Quote:

> Hi,

>         I must save object like Dictionary on my SQL/Server.
> I want to save a Dictionary (containing all type of object) as string in
> a varchar data.
> How can i make this? (with de printString method)
> And how can I make a Dictionary with this result ?

> If it isn't the good email for this question can you tell where can I
> send my question.

>                                 Thank you from Fred

Hi,
If I understand your question correctly, you want to store an object
as a string and then want to recreate that object from that string.

VisualWorks provides a method #storeString defined in 'Object'.

        anyObject storeString
would return a string that can be used to recreate that object later.
However, you need to have the compiler in the image to be able to recreate that
object.

If you want to recreate objects in a stripped (compiler-less) image,
it is fairly easy to write a simple parser that reads in the string
and reconstructs the object by invoking the appropriate methods. Look into
Object>>#storeOn: method to see the output format of storeString.

hope that helps
Prashant

--

----------------------------------------------------------------------

----------------------------------------------------------------------



Mon, 26 Apr 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Dict. to String and String to Dict. with Visual Works

2. converting string to dict ?

3. expanding a list and dict to a *args and **dict

4. Dict can't update with dict-like objects

5. NewBuiltins: added dict() -- inverse of dict.items()

6. Are strings copied when passed to a regex object if a dict lookup

7. Builtin dict should be callable, since a dict defines a funct ion

8. Builtin dict should be callable, since a dict defines a function

9. dict = urllib.urldecode(string) ?

10. Tcl8.5: [string map $dict ...] and ordering inside $dict

11. Question about working with strings and displaying strings properly

12. Visual works: Environment string in Sybase and ODBC ?

 

 
Powered by phpBB® Forum Software