TTos() and DateTime() in xHB commercial

Post Reply
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

TTos() and DateTime() in xHB commercial

Post by TimStone »

Most of my builds are with Harbour and Microsoft Visual Studio. There are two functions used TToS( ) and DateTime() in database.prg and rpreview.prg and there is no problem at all with them.

The issue is I'm trying to also build an xHarbour ( .com ) version ( Pelles ) for compatibility purposes, and these functions are not supported. Is there code available to link in for these ?

Thanks.
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: TTos() and DateTime() in xHB commercial

Post by nageswaragunupudi »

Both the functions TTOS() and DATETIME() are provided by xHarbour, since a long time.

I built this small program with buildxhb.bat (using xhb.com) in fwh\samples folder.

Code: Select all

#include "fivewin.ch"

function Main()

   local tDate, cDateTime

   SET DATE AMERICAN
   SET CENTURY ON

   tDate       := DateTime()
   cDateTime   := TTOS( tDate )

   ? tDate,cDateTime

return nil
 
Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Re: TTos() and DateTime() in xHB commercial RESOLVED

Post by TimStone »

In older versions of FWH, when using Harbour, I had to use the functions as:

HB_DateTime()
HB_TToS( )

These were not compatible with my version of xHarbour.com

Now, removing HB_ allows both the Harbour and xHarbour builds.
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: TTos() and DateTime() in xHB commercial

Post by karinha »

Code: Select all

#include "fivewin.ch"

function Main()

   local tDate, cDateTime

   SET DATE AMERICAN
   SET CENTURY ON

   #IFDEF __XHARBOUR__

      tDate       := DateTime()
      cDateTime   := TTOS( tDate )

   #ELSE  // Harbour

      tDate       := HB_DateTime()
      cDateTime   := HB_TTOS( tDate )

   #ENDIF

   ? tDate, cDateTime

return nil
 
João Santos - São Paulo - Brasil
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: TTos() and DateTime() in xHB commercial

Post by nageswaragunupudi »

Now, removing HB_ allows both the Harbour and xHarbour builds.
This is possible because we are now including xhb.lib for Harbour builds.

We also need not use #ifdef's as above.
Regards

G. N. Rao.
Hyderabad, India
Post Reply