FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TTos() and DateTime() in xHB commercial
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
TTos() and DateTime() in xHB commercial
Posted: Tue Jul 23, 2019 11:59 PM

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
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: TTos() and DateTime() in xHB commercial
Posted: Wed Jul 24, 2019 12:24 AM
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 (fw): Select all Collapse
#include "fivewin.ch"

function Main()

   local tDate, cDateTime

   SET DATE AMERICAN
   SET CENTURY ON

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

   ? tDate,cDateTime

return nil


Regards



G. N. Rao.

Hyderabad, India
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: TTos() and DateTime() in xHB commercial RESOLVED
Posted: Wed Jul 24, 2019 06:22 PM

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
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: TTos() and DateTime() in xHB commercial
Posted: Wed Jul 24, 2019 06:48 PM
Code (fw): Select all Collapse
#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 - Phone: +55(11)95150-7341
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: TTos() and DateTime() in xHB commercial
Posted: Wed Jul 24, 2019 07:12 PM
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

Continue the discussion