At 10:14 PM -0400 10/13/06, Richard wrote:
So if my 2 dates reference the same object, how do I go about getting my hands on 2 distinct date objects? I need one that is fixed (my reference date) and another that I can manipulate.

Every time you call New, you get a separate new object, a date in this case.

On Oct 13, 2006, at 7:45 PM, Richard wrote:

I have d1 declared as a global date. It's been "new"ed when the window opens.

In a pushbutton I have the following code:

  Dim d2 As New Date

This creates a new date and d2 references it


  d2 = d1

This makes d2 reference the same date object as d1, and results in discarding the new date you just created in the previous line.

  d2.day = d2.day+1

This increments the only date object you have, which is referenced by both d1 and d2 at this point.

Instead of using d2 = d1 which makes d2 reference the same date object as d1, I think you're trying to give the d2 date object the same date value as the d1 date object. If so you just need to assign d2 the totalseconds value from d1.

Replace d2 = d1 with d2.totalseconds = d1.totalseconds, as has been suggested.

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

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

Reply via email to