View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] tom.medland@googlemail.com is offline
external usenet poster
 
Posts: 3
Default Persistent Data Structures in VBA

On 10 Sep, 13:00, Tom Ogilvy
wrote:
If declared at the module level (outside any procedure), they are persistent
unless you hit the reset button or use the END statement.

Beyond that, I can't think of another in memory solution.

--
Regards,
Tom Ogilvy

" wrote:
I am using dictionaries and collections in VBA, and I have a problems
whenever there is an error and I have to stop the code execution I
loose the contents of these data structures. I come from a c++
background and to get around this sort of issue I would use persistent
data structures. Is there anything like this in VBA?


Thanks
Tom


That is the problem, often I do have to hit the END statement and so
loose the state. I am toying with the idea of using ADO record sets
wrapped in a class. Essentially it would use the users temp directory
to store some sort of file representation of data objects. This would
mean that even if the VBA code execution is stopped ( i.e. END called)
the objects could recover their data from the persisted files. The
drawback with this is I would have to work out the time efficiencies
of the storing and lookup as well as re-initialisation

Tom