Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Tue Apr 24, 2018 3:52 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Date Voodoo?
PostPosted: Thu Dec 06, 2012 11:54 pm 
Offline

Joined: Sun Jan 28, 2007 2:38 pm
Posts: 231
Is this normal?

Run this and tell me why the value of d get changed:

dim d as new date
d.Hour=0
d.Minute=0
d.Second=0

dim d1 as Date =d
dim d2 as Date =d
dim d3 as Date =d
dim d4 as Date =d
dim d5 as Date =d

d1.day=d1.day-1 //d.date is going down?
d2.day=d2.day-2 //d.date is going down?
d3.day=d3.day-3 //d.date is going down?
d4.day=d4.day-4 //d.date is going down?
d5.day=d5.day-5 //d.date is going down?


Top
 Profile  
Reply with quote  
 Post subject: Re: Date Voodoo?
PostPosted: Fri Dec 07, 2012 12:51 am 
Offline
User avatar

Joined: Mon Jan 02, 2012 1:51 am
Posts: 382
Location: India
All d, d1, d2, d3, d4, d5 point to same object.

_________________
Amitava Karan
Real Studio 2012 Release 1
Windows 7 (32 bit)
Mac OS X Version 10.7


Top
 Profile  
Reply with quote  
 Post subject: Re: Date Voodoo?
PostPosted: Fri Dec 07, 2012 1:01 am 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
Use the copy constructor

dim d1 as new Date(d)
dim d2 as new Date(d)
etc.


Top
 Profile  
Reply with quote  
 Post subject: Re: Date Voodoo?
PostPosted: Fri Dec 14, 2012 10:11 am 
Offline

Joined: Sun Jul 16, 2006 1:48 pm
Posts: 276
Location: Switzerland
timhare wrote:
Use the copy constructor

dim d1 as new Date(d)
dim d2 as new Date(d)
etc.


Oh dear.... ^^
Thanks


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group