On Apr 10, 2007, at 14:48 UTC, Steve Garman wrote: > In a message regarding Re: Help Creation and Modification Dates dated > Tue, 10 Apr 2007 15:06:58 +0200, Arnaud Nicolet said that ... > > > I think this is the fault: > > > > Dim DateCr, DateMod as date > > > With this syntax, you have DateCr and DateMod pointing to the same > > date (you modify one: the other is modified as well). So, when you > > say "DateMod=new date", DateCr also becomes a "new date". It's a > hard- > > to-explain concept. > > Arnaud, I really don't think you're right about that. > > As the code is written, neither variable is pointing to a date and > there should be no problem as long as they are instatntiated > separately.
Steve is quite right. The declaration "Dim A, B as Date" simply creates two date references, A and B, both initialized to nil. And whenever you assign to one of them, it doesn't affect the other one; assignment only affects the reference you're assigning to. So if you did A = B then A and B now point to the same thing (which could be nil, or if B had previously been assigned some date object, then A and B now both refer to that object). But if you later do A = somethingElse then this makes A refer to something else; it doesn't affect B at all. Best, - Joe -- Joe Strout -- [EMAIL PROTECTED] Verified Express, LLC "Making the Internet a Better Place" http://www.verex.com/ _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
