DateTimeAsDate

 (Available in 01 TS COM - TS_COM_VariantArg)

Purpose

Get the 'DateTimeAsDate' property

Syntax

? oIObject:DateTimeAsDate

Description

Get the 'DateTimeAsDate' property. If this setting is not explicitly set by the application then the default value will be collected from the owner of the object, if no owner is available ( or the owner does not export a 'DateTimeAsDate' property ) then the system default value will be collected from the 'TS_COMDateTimeAsDate()' function.

Returns

DateTimeAsDate = LOGIC

Example

FUNCTION TS_Variant2Usual( ... ) AS USUAL...
   ...
   DO CASE
   CASE siVariantType==...
      ...
   CASE siVariantType==VT_DATE
      uRetVal:=REAL8( pstruWinVariantArg.uVariant.pdate )
      IF lDateTimeAsDate
         uRetVal:=DATE( _CAST, DWORD( Integer( uRetVal ) )+TS_CONVERT_COM_DATE )
      ELSE
         uRetVal:=TS_DateTimeFromVariant{ oOwner, uRetVal }
      END
   CASE siVariantType==...
      ...
   END
   ...
RETURN uRetVal

FUNCTION SomeFunction( ) AS VOID PASCAL
   ...
   oDateTimeFromVariant:=oSomeIObject:CMGetDate( )
   ? "Date =", DateTimeFromVariant:DateString
   ? "Time =", DateTimeFromVariant:TimeString
   ...
RETURN

Source

ACCESS DateTimeAsDate AS LOGIC PASCAL CLASS TS_VariantArg
LOCAL lDateTimeAsDate AS LOGIC
   TSTrace Enter
   DO CASE
   CASE SELF:_DateTimeAsDate==0U
      lDateTimeAsDate:=FALSE
   CASE SELF:_DateTimeAsDate==1U
      lDateTimeAsDate:=TRUE
   CASE IsAccess( SELF:Owner, #DateTimeAsDate )
      lDateTimeAsDate:=IVarGet( SELF:Owner, #DateTimeAsDate )
   OTHERWISE
      lDateTimeAsDate:=TS_COMDateTimeAsDate( )
   END
   TSTrace Leave
RETURN lDateTimeAsDate