gettingstarted
[Top] [All Lists]

Assigning one Object to Another

To: getting Started <gettingstarted at lists dot realsoftware dot com>
Subject: Assigning one Object to Another
From: "Jon" <jon at scruffyduck dot co dot uk>
Date: Wed, 28 Jul 2004 16:47:40 +0100
Delivered-to: gettingstarted at lists dot realsoftware dot com
Priority: normal
I'm sure I saw a reference to this a day or two ago, but did not take 
much notice of it.  Having searched the archives I can't find it.

I have a custom class which is instantiated as PilotData.  There is 
one instance and it stores preference and other user information.  I 
need to make a copy of it before I carry out a specific operation so 
that if the operation fails I can roll back.  I did this by 
instantiating a second object from the class and called it 
TempPilotData.

Before the operation I did:

TempPilotData=PilotData

then carried out the operation which changes the values in PilotData. 
 When the operation is failed I used

PilotData =TempPilotData

But this does not work since it seems that the equivalence at the 
start points to the original object and does not create a copy.

I may be talking through my hat here - but I guess I am missing 
something if I cannon assign the values from one object to another of 
the same class in such a way that the information is independent

Jon


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>