Page 1 of 1

how to distinguish xhb.org or xhb.com with ifdef

Posted: Tue Sep 16, 2008 7:32 pm
by dempty
Hi guys,

I started to migrate my system to work under xhb.com and sqlrdd, but I have to keep my old sql connection code, because for my clients who still using my old system version i must keep the support and i dont wanna separate my code for each version of xharbour.
So for do that i thought about distinguish in my code with ifdef...some think like this:

Code: Select all | Expand

   #ifdef __HARBOUR_COM__
      //sqlrdd connection
   #else
      //old sql connection
   #endif


Someone Has any idea how to distinguish that ?

thanks!

Re: how to distinguish xhb.org or xhb.com with ifdef

Posted: Wed Sep 17, 2008 6:49 am
by Patrick Mast
dempty wrote:I started to migrate my system to work under xhb.com and sqlrdd, but I have to keep my old sql connection code, because for my clients who still using my old system version i must keep the support and i dont wanna separate my code for each version of xharbour.
So for do that i thought about distinguish in my code with ifdef...some think like this:

Code: Select all | Expand

   #ifdef __HARBOUR_COM__
      //sqlrdd connection
   #else
      //old sql connection
   #endif


Someone Has any idea how to distinguish that ?

thanks!

Sorry, there is no __XHARBOUR_COM as xHarbour Builder uses xHarbour's core engines. I would add a define of my own like this:

#define __SQLRDD__

Than:

#ifdef __SQLRDD__
...
#endif

Patrick