TTos() and DateTime() in xHB commercial

TTos() and DateTime() in xHB commercial

Postby TimStone » 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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

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

Postby nageswaragunupudi » 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: Select all  Expand view
#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
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

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

Postby TimStone » Wed Jul 24, 2019 6: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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

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

Postby karinha » Wed Jul 24, 2019 6:48 pm

Code: Select all  Expand view

#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
User avatar
karinha
 
Posts: 7811
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

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

Postby nageswaragunupudi » Wed Jul 24, 2019 7: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
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 66 guests