New topic: Date Constructor query
<http://forums.realsoftware.com/viewtopic.php?t=46603> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message Jack Allen Post subject: Date Constructor queryPosted: Fri Jan 18, 2013 7:32 am Joined: Mon Jan 02, 2006 4:02 pm Posts: 59 Location: Glasgow - UK I have a window that has a date property printDate as date This gets initialised by the window's open event and is only ever read. On another window it is accessed If targetDate <> nil then targetDate = new date(w.printDate) I initialise a new date object using the original in the constructor. What I've found is, if I change targetDate that change is also reflected in printDate suggesting that using one date in the constructor ties both together, change one and you change both. Is this how it's supposed to work? Not what I expected, I want to independently controlled objects. Thanks Jack Top ktekinay Post subject: Re: Date Constructor queryPosted: Fri Jan 18, 2013 7:54 am Joined: Mon Feb 05, 2007 5:21 pm Posts: 374 Location: New York, NY No, that's not how it works, and I can't reproduce your results. "dim d2 as new Date( d1 )" creates an independent clone here, so my thinking is 1) this is a bug in an older version of Real Studio, or 2) somewhere in your code is "targetDate = w.printDate". _________________ Kem Tekinay MacTechnologies Consulting http://www.mactechnologies.com/ Need to develop, test, and refine regular expressions? Try RegExRX. Top Jack Allen Post subject: Re: Date Constructor queryPosted: Fri Jan 18, 2013 9:44 am Joined: Mon Jan 02, 2006 4:02 pm Posts: 59 Location: Glasgow - UK ktekinay wrote:No, that's not how it works, and I can't reproduce your results. "dim d2 as new Date( d1 )" creates an independent clone here, so my thinking is 1) this is a bug in an older version of Real Studio, or 2) somewhere in your code is "targetDate = w.printDate". Thanks for that ... you are absolutely right. I have that very line of code ... if a section I thought I had removed. Removed it now and program is behaving as I want. Thanks for getting back to me. Jack Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
