I am looking to switch from xHarbour to Harbour and was wondering if there is a list of things I need to watch out for ?
Thanks,
Jeff Barnes
(FWH 16.11, xHarbour 1.2.3, Bcc730)
Jeff Barnes
(FWH 16.11, xHarbour 1.2.3, Bcc730)
I am looking to switch from xHarbour to Harbour and was wondering if there is a list of things I need to watch out for ?
Very simple.
Please add #include "hbcompat.ch" at the top of every module and link xhb.lib in the link script. Mostly this is what all that needs to be done.
However very few incompatibles remain.
Negative array indexes which work in XHarbour do not work in Harbour.
Eg: You need to change aData[ -1 ] as ATail( aData ),
aData[ -n ] as aData[ Len( aData ) - n + 1 ]
In case you have used array type of indexes to Character variables you need to convert them as SubStr.
Except these two, everythingelse should work well with Harbour.
Jeff Barnes wrote:I am looking to switch from xHarbour to Harbour and was wondering if there is a list of things I need to watch out for ?
Franklin Demont wrote:Jeff Barnes wrote:I am looking to switch from xHarbour to Harbour and was wondering if there is a list of things I need to watch out for ?
Jeff ,
I have finished the conversion , a big aplication (+/- 30 prg-files , i worked on it during a month) . The goal is to have a aplication that can be build with xharbour and harbour.
I will try to give the problems which i had , hopely this day
Some problems can you find in this forum the last days
Frank
// Mainmodule , first prg-file
# include "FiveWin.ch"
# ifdef __HARBOUR__
# ifndef __XHARBOUR__
# include "xhb.ch"
# define _oWnd g():oWnd
# else // __XHARBOUR__
GLOBAL _oWnd
# endif // __XHARBOUR__
# endif
PROC MAIN
**********
DEFINE WINDOW _oWnd FROM 0, 0 TO 24, 80 MDI;
MENU BuildMenu()
ACTIVATE WINDOW _oWnd MAXIMIZED
RETURN
function BuildMenu()
************************
local oMenu
LOCAL oMenuItem
MENU oMenu
MENUITEM "Dialog from Main window";
ACTION TestDlg()
ENDMENU
RETURN oMenu
***********************************************************************
//DIALOG.PRG , second prg-file
# include "FiveWin.ch"
# ifdef __HARBOUR__
# ifndef __XHARBOUR__
# include "xhb.ch"
# define _oWnd g():oWnd
# else // __XHARBOUR__
GLOBAL EXTERNAL _oWnd
# endif // __XHARBOUR__
# endif
PROC TestDlg()
**************
LOCAL oDlg
DEFINE DIALOG oDlg OF _oWnd FROM 0, 0 TO 20, 60
ACTIVATE DIALOG oDlg
RETURN
***********************************************************************
//GLOBALVAR.PRG third prg-file , only linked in with HARBOUR
# include "FiveWin.ch"
# ifdef __HARBOUR__
# include "xhb.ch"
STATIC g
# endif
class GlobalVar
***************
VAR oWnd
END CLASS
***************
Function g()
***********
RETURN g