Re: Object Serialisation



If the contents of an array can be repesented as text then you could use
join() to convert the array into a text string and then write it to a text
file. Plenty of examples of wrting to a file to be had by searching this
newsgroup, so no need for me to repeat any of them here.

Or if you want something more structured then use an xml representation

<propertyname1>
<val>value1</val>
<val>value2</val>
....
<val>valueX</val>
</propertyname1>

<propertyname2>
......
</propertyname2>

etc.

or write the values to an Excel *** and use that as your cache.

You might want to investigate speeding up your object-building code though.
If the objects are built without a lot of user-input then it might be
quicker just to rebuild them from scratch.

Tim

"pinkfloydfan" <lloyd.greensite@xxxxxxxxxxxxxx> wrote in message
news:1177890486.149109.157280@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thanks for the input Tim

Unfortunately, I am only familiar with VBA and don't have any
knowledge of other programming languages at this time. The specific
object I want to serialise has some simple core data that it uses to
create a path-dependent result. I store every step of the path in an
array and it not unusual to have between 250-1250 steps for a single
object.

This process is then repeated many thousands of times and all these
objects are stored in a master object / collection.

You can appreciate that I don't really want to wait a few minutes to
build the master object(s) each time I use my application and so was
looking for a way to store that data outside of Excel and re-load it
as I need it. Actually if this can be achieved efficiently I can
think of a lot of uses for this process.

Perhaps if anyone can guide me on how to write an object's properties
to a text file and read them back in that would be a good place to
start...or is there a more efficient method?

Many Thanks
Lloyd



.