[Gambas-user] pickle?

Doriano Blengino doriano.blengino at ...1909...
Wed Aug 12 08:42:24 CEST 2009


Leonardo Miliani ha scritto:
> Steven revimmo ha scritto:
>   
>> Hi,
>>
>> As far as I know, it's used to write/read any variable in a file.
>> So, you can write objects, numbers, arrays, anything into a file, and
>> get them back
>> without conversion or analyses of the text in the file.
>>     
>
> Something similar to a memory dump of the object, isn't it?
> Interesting... So it could be possible, i.e., to create a form, dump it 
> into a file and load it at runtime from a Gambas app, maybe?
>   
This would be really great; unfortunately, it is not simple to do, 
because a memory dump does not work. A form has some properties, which 
can be dumped in a file. Then it has a reference to every object the 
form contains: labels, buttons and so on. Those objects cannot be dumped 
in a file by the form, because the form does not know enough of them to 
do it - every single object must dump itself, and must be able to reload 
itself from the data in the file, calling constructors for every 
sub-object it contains, and so on. This means extend every single object 
to put methods in it for streaming. A lot of work.

Regards,
Doriano





More information about the User mailing list