Hi Antonio,

> I need to modify behavior a function. I use the next code... but is a bit
> ugly... something alternative ?
> Anything future inconveniences ?

Use MY_ORDLISTADD() for your own stub and leave ORDLISTADD() as is, 
then add #xtranslate ORDLISTADD(<x,...>) => MY_ORDLISTADD(<x>) to 
your app header. You can add such header with -u+myheader.ch 
compiler switch, or just #include it in every .prg.

It's never a safe or good practice to create wrapper with 
original name but different behavior in real applications.

[ Moreover, you have to carefully check the licensing 
issues and requirements when including modified Harbour 
source code in your closed-source application. ]

Brgds,
Viktor

> Regards
> 
> INI CODE >>>>>>>>>>>>
> //-------------------------------------------------------------------------/
> /
> FUNCTION OrdListAdd(cPathFile)
> Local cPathDbf
> Local cPathFile2:= cPathFile
> Local cNtx
> *
> cPathDbf:= PathFile( DbInfo(DBI_FULLPATH) )
> cNtx:= FileNoPath(cPathFile)
> cPathFile2:= cPathDbf+ "\"+ cNtx
> RETURN ORDLISTADDBIS(cPathFile2)
> *
> *
> *
> #IFDEF __HARBOUR__
>   #IFNDEF __XHARBOUR__
>      #PRAGMA BEGINDUMP
>         #include "hbapi.h"
>         #include "hbapirdd.h"
>         #include "hbapierr.h"
>         #include "hbapiitm.h"
>         #include "hbvm.h"
>         #include "hbset.h"
>         HB_FUNC( ORDLISTADDBIS )
>         {
>            AREAP pArea = ( AREAP ) hb_rddGetCurrentWorkAreaPointer();
>            if( pArea )
>            {
>               DBORDERINFO pOrderInfo;
>               HB_ERRCODE errCode;
>               /* Clipper clears NETERR flag when index is open */
>               hb_rddSetNetErr( FALSE );
>               memset( &pOrderInfo, 0, sizeof( DBORDERINFO ) );
>               pOrderInfo.atomBagName = hb_param( 1, HB_IT_STRING );
>               pOrderInfo.itmOrder    = hb_param( 2, HB_IT_STRING );
>               if( !pOrderInfo.atomBagName )
>               {
>                  if( ! HB_ISNIL( 1 ) )
>                     hb_errRT_DBCMD( EG_ARG, EDBCMD_ORDLSTADD_BADPARAMETER,
> NULL, HB_ERR_FUNCNAME );
>                  return;
>               }
>               pOrderInfo.itmResult = hb_itemNew( NULL );
>               errCode = SELF_ORDLSTADD( pArea, &pOrderInfo );
>               if( !pOrderInfo.itmResult ||
> HB_IS_NIL( pOrderInfo.itmResult ) )
>                  hb_retl( errCode == HB_SUCCESS );
>               else
>                  hb_itemReturn( pOrderInfo.itmResult );
>               hb_itemRelease( pOrderInfo.itmResult );
>            }
>            else
>               hb_errRT_DBCMD( EG_NOTABLE, EDBCMD_NOTABLE, NULL,
> HB_ERR_FUNCNAME );
>         }
>      #PRAGMA ENDDUMP
>   #ELSE
>      #PRAGMA BEGINDUMP
>         #include "hbapi.h"
>         #include "hbapirdd.h"
>         #include "hbapierr.h"
>         #include "hbapiitm.h"
>         #include "hbvm.h"
>         #include "hbset.h"
>         HB_FUNC( ORDLISTADDBIS )
>         {
>            HB_THREAD_STUB
>            AREAP pArea = ( AREAP ) hb_rddGetCurrentWorkAreaPointer();
>            if( pArea )
>            {
>               DBORDERINFO pOrderInfo;
>               ERRCODE errCode;
>               /* Clipper clears NETERR flag when index is open */
>               hb_rddSetNetErr( FALSE );
>               memset( &pOrderInfo, 0, sizeof( DBORDERINFO ) );
>               pOrderInfo.atomBagName = hb_param( 1, HB_IT_STRING );
>               pOrderInfo.itmOrder    = hb_param( 2, HB_IT_STRING );
>               if( !pOrderInfo.atomBagName )
>               {
>                  if( !ISNIL( 1 ) )
>                     hb_errRT_DBCMD( EG_ARG, EDBCMD_ORDLSTADD_BADPARAMETER,
> NULL, "ORDLISTADD" );
>                  return;
>               }
>               pOrderInfo.itmResult = hb_itemNew( NULL );
>               errCode = SELF_ORDLSTADD( pArea, &pOrderInfo );
>               if( !pOrderInfo.itmResult ||
> HB_IS_NIL( pOrderInfo.itmResult ) )
>                  hb_retl( errCode == SUCCESS );
>               else
>                  hb_itemReturn( pOrderInfo.itmResult );
>               hb_itemRelease( pOrderInfo.itmResult );
>            }
>            else
>               hb_errRT_DBCMD( EG_NOTABLE, EDBCMD_NOTABLE, NULL,
> "ORDLISTADD" );
>         }
>      #PRAGMA ENDDUMP
>   #ENDIF
> #ENDIF
> 
> END CODE >>>>>>>>>>
> 
> 
> 
> _______________________________________________
> Harbour mailing list (attachment size limit: 40KB)
> Harbour@harbour-project.org
> http://lists.harbour-project.org/mailman/listinfo/harbour

_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to