|
-
Caching objects
I've been having problems trying to cache the values of a class to another
variable (in order to re-create an Undo-Redo scenario without having to go
through each property in the class).
When I set the contents of one of classes to another, (even when passing
byval to a procedure) and then change the original class, the cached class
is also affected. Is there anyway to in effect duplicate the contents of
a class and change the original without affecting the other?
I've probably missed something elementary here.
Thanks in advance,
Simon Fitzpatrick
-
Re: Caching objects
Simon,
You'll have to roll your own Clone method. There is no way to copy an
object in Visual Basic. Passing an object ByVal merely copies the reference,
not the object.
Regards,
D. Patrick Hoerter
Simon Fitzpatrick wrote in message <38fec375$1@news.devx.com>...
>
>I've been having problems trying to cache the values of a class to another
>variable (in order to re-create an Undo-Redo scenario without having to go
>through each property in the class).
>
>When I set the contents of one of classes to another, (even when passing
>byval to a procedure) and then change the original class, the cached class
>is also affected. Is there anyway to in effect duplicate the contents of
>a class and change the original without affecting the other?
>
>I've probably missed something elementary here.
>
>Thanks in advance,
>
>Simon Fitzpatrick
Similar Threads
-
By Gengar003 in forum Java
Replies: 10
Last Post: 05-15-2005, 06:14 AM
-
By Michael Cole in forum Database
Replies: 2
Last Post: 04-02-2003, 03:06 PM
-
By Michael Cole in forum oracle.general
Replies: 0
Last Post: 02-20-2003, 10:25 PM
-
By Dave Fleischman in forum Enterprise
Replies: 3
Last Post: 08-18-2000, 01:10 PM
-
By Oliver Lennon in forum Enterprise
Replies: 3
Last Post: 04-18-2000, 12:30 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks