Re: SysTime in a Struct

2012-03-06 Thread albatroz
Hi Ali, only today I had the time to implement your suggestion it's working now has expected. Thank you for your patience, also thank you for the work translating such a good D book to English. On Friday, 2 March 2012 at 00:00:10 UTC, Ali Çehreli wrote: On 03/01/2012 03:46 PM, albatroz wr

Re: SysTime in a Struct

2012-03-01 Thread Jonathan M Davis
On Thursday, March 01, 2012 16:00:09 Ali Çehreli wrote: > On 03/01/2012 03:46 PM, albatroz wrote: > > Hi Ali, just tring to define a type that holds this information. It was > > just an attempt to create a type DateTime with the values from the known > > strings, I thought it was possible to create

Re: SysTime in a Struct

2012-03-01 Thread Ali Çehreli
On 03/01/2012 03:46 PM, albatroz wrote: > Hi Ali, just tring to define a type that holds this information. It was > just an attempt to create a type DateTime with the values from the known > strings, I thought it was possible to create the definition directly in > the Struct, with no need for an

Re: SysTime in a Struct

2012-03-01 Thread albatroz
Are you trying to record the time when a prevEv is copied from another one? If not, I suggest not defining this(this). It is the postblit, to make things right for rare structs and only when the compiler generated copying is wrong for a that type. Or, are you just trying to define a type that

Re: SysTime in a Struct

2012-03-01 Thread Jonathan M Davis
On Thursday, March 01, 2012 15:15:00 albatroz wrote: > Hi, > > I have defined this struct > struct preEv { > string edate; //010112 > string etime; //00:00:00 > string etext; // > SysTime esystime; > this (this) { > SysTime esystime = SysTime(DateTime( > Clock.currTime.year, > to!int(this.edate[2.

Re: SysTime in a Struct

2012-03-01 Thread Ali Çehreli
On 03/01/2012 09:14 AM, albatroz wrote: > Have fixed the segfault by using DateTime instead of SysTime. >> >> That is a separate local variable within this(this). Also, this(this) >> is the postblit (similar to a copy constructor). Is that what you want >> to define? > > No, but not using this(thi

Re: SysTime in a Struct

2012-03-01 Thread albatroz
Have fixed the segfault by using DateTime instead of SysTime. That is a separate local variable within this(this). Also, this(this) is the postblit (similar to a copy constructor). Is that what you want to define? No, but not using this(this) will fail to build with: static variable _initial

Re: SysTime in a Struct

2012-03-01 Thread Ali Çehreli
On 03/01/2012 06:15 AM, albatroz wrote: > Hi, > > I have defined this struct > struct preEv { > string edate; //010112 > string etime; //00:00:00 > string etext; // > SysTime esystime; That is a member of this type. > this (this) { > SysTime esystime = SysTime(DateTime( That is a separate local

SysTime in a Struct

2012-03-01 Thread albatroz
Hi, I have defined this struct struct preEv { string edate; //010112 string etime; //00:00:00 string etext; // SysTime esystime; this (this) { SysTime esystime = SysTime(DateTime( Clock.currTime.year, to!int(this.edate[2..4]), to!int(this.ed