Should VDK_Date, VDK_Time, VDK_DateTime have value methods operator = and such?

Matthew Jew mjew at icnc.com
Mon May 24 14:09:50 CDT 2004


Ruslan,

I am (finally) getting around to trying to use the VDK_DateTime 
assignment tip you sent to me
over 8 months ago.

However, I cannot seem to find the "DataPtr()" method call you refer to 
in your email.

I am actually trying to save the DateTime value into a long long 
variable, like so:

	dateTimeLowerBound = 
*(llong*)aGroupDayTotalsTable->lastUpdate.DataPtr();

However, I get the following error (in ProjectBuilder):

Valentina/HitReportDBManager.mm:751: error: calling type `DataPtr' like 
a method

When I search the header files (I think I am still using 1.9.8), I 
cannot find any routine
named "DataPtr" at all.

What am I doing wrong?

- Matthew

> on 9/19/03 6:49 AM, Matthew Jew at mjew /at/ icnc DO.T com wrote:
>
> > Ruslan,
> >
> > Would it be useful to have operator = and value getters for the 
> various
> > Date and Time classes?
> >
> > I find myself needing to copy values from one table to another, and 
> now
> > I have to
> > do something like:
> >
> > long aYear;
> > ushort aMonth;
> > ushort aDay;
> > ushort anHour;
> > ushort aMinute;
> > ushort aSecond;
> >
> > theSourceTable->modDateTimeField.GetDate( aYear, aMonth, aDay );
> > theSourceTable->modDateTimeField.GetTime( anHour, aMinute, aSecond );
> >
> > ... and then later ...
> >
> > theDestinationTable->modDateTimeField.SetDate( aYear, aMonth, aDay );
> > theDestinationTable->modDateTimeField.SetTime( anHour, aMinute, 
> aSecond
> > );
> >
> > Even worse, I need to retrieve hundreds of these DateTimes in a 
> batch,
>
> Hi Mathew,
>
> You have simpler way right now.
>
> For Date and Time that have 4 bytes value:
> *(long*)f1.DataPtr() = *(long*)f2.DataPtr();
>
> For DateTime that have 8 bytes value:
> *(llong*)f1.DataPtr() = *(llong*)f2.DataPtr();
>
>
> And of course you need before that check IsNull()
>
> if( f2.IsNull() )
> {
> f1.putIsNull( true );
> }
> else
> {
> *(long*)f1.DataPtr() = *(long*)f2.DataPtr();
> }
>
>
> FYI: in 2.0 we change many things.
> for example, we have add new interface I_Value.
> and you task in 2.0 API will be as simple as one line of code:
>
> f1->put_Value( f2->get_Value() );
>
>
> -- 
> Best regards,
> Ruslan Zasukhin [ I feel the need...the need for speed ]
> -------------------------------------------------------------
> e-mail: ruslan /at/ paradigmasoft DO.T com
> web: http://www.paradigmasoft.com
>
> To subscribe to the Valentina mail list go to:
> http://lists.macserve.net/mailman/listinfo/valentina
> -------------------------------------------------------------
>
> _______________________________________________
> Valentina mailing list
> Valentina /at/ lists DO.T macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina



More information about the Valentina mailing list