From fd2ba2ce8dcd2311fc5ca845ca0184e858f5e7b9 Mon Sep 17 00:00:00 2001 From: Luiz Rafael Culik Date: Fri, 10 Nov 2000 01:29:57 +0000 Subject: [PATCH] See changelog 2000-11-9 23:30 GMT -3 --- harbour/ChangeLog | 4 +++ harbour/source/rdd/rddcpy.c | 54 ++++++++++++++++++++----------------- 2 files changed, 33 insertions(+), 25 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b1faf4a1b5..91f0c233df 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,7 @@ +2000-11-09 23:30 GMT -3 (for) Harrier + *source/rdd/rddcpy.c + *Some fix suggested by Victor + 2000-11-09 11:00 UTC+0800 Ron Pinkas * source/pp/ppcore.c * Added parameter BOOL bRule to md_strAt() to differentiate between searching a Rule Text or an Expression. diff --git a/harbour/source/rdd/rddcpy.c b/harbour/source/rdd/rddcpy.c index 880d923a24..f4c3659c8f 100644 --- a/harbour/source/rdd/rddcpy.c +++ b/harbour/source/rdd/rddcpy.c @@ -68,7 +68,7 @@ static LPAREANODE GetTheOtherArea( char *szDriver, char * szFileName ) if( SELF_OPEN( ( AREAP ) pAreaNode->pArea, &pInfo ) == FAILURE ) { - hb_errRT_DBCMD( EG_OPEN, 0, NULL, "DBAPP" ); // Could not open it + hb_errRT_DBCMD( EG_OPEN, NULL, NULL, "DBAPP" ); // Could not open it SELF_RELEASE( ( AREAP ) pAreaNode->pArea ); hb_xfree( pAreaNode ); return NULL; @@ -146,19 +146,19 @@ static ERRCODE rddMoveRecords( char *cAreaFrom, char *cAreaTo, PHB_ITEM pFields, if ( cAreaTo ) // it's a COPY TO { pAreaRelease = GetTheOtherArea( szDriver, cAreaTo ); - pAreaTo = (AREAP) pAreaRelease->pArea; + pAreaTo = pAreaRelease->pArea; } else - pAreaTo = (AREAP) s_pCurrArea->pArea; + pAreaTo = s_pCurrArea->pArea; if ( cAreaFrom ) // it's an APPEND FROM { // make it current pAreaRelease = s_pCurrArea = GetTheOtherArea( szDriver, cAreaFrom ); - pAreaFrom = (AREAP) pAreaRelease->pArea; + pAreaFrom = pAreaRelease->pArea; } else - pAreaFrom = (AREAP) s_pCurrArea->pArea; + pAreaFrom = s_pCurrArea->pArea; // or one or the other but necer none if ( !pAreaRelease ) // We need another Area to APPEND TO @@ -222,30 +222,34 @@ static ERRCODE rddMoveRecords( char *cAreaFrom, char *cAreaTo, PHB_ITEM pFields, HB_FUNC( __DBAPP ) { - hb_retni( rddMoveRecords( hb_parc( 1 ), // File From - NULL, // TO current area - ISNIL( 2 ) ? NULL : hb_param( 2, HB_IT_ARRAY ), // Fuelds - ISNIL( 3 ) ? NULL : hb_param( 3, HB_IT_BLOCK ), // For - ISNIL( 4 ) ? NULL : hb_param( 4, HB_IT_BLOCK ), // While - ISNIL( 5 ) ? 0 : hb_parni( 5 ), // Next - ISNIL( 6 ) ? 0 : hb_parni( 6 ), // Record - ISNIL( 7 ) ? 0 : hb_parnl( 7 ), // Rest - ISNIL( 8 ) ? NULL : hb_parc( 8 ) )); // RDD - + if( ISCHAR( 1 ) ) + { + rddMoveRecords( hb_parc( 1 ), /* File From */ + NULL, /* TO current area */ + hb_param( 2, HB_IT_ARRAY ), /* Fields */ + hb_param( 3, HB_IT_BLOCK ), /* For */ + hb_param( 4, HB_IT_BLOCK ), /* While */ + hb_parnl( 5 ), /* Next */ /* Defaults to zero on bad type */ + hb_parnl( 6 ), /* Record */ /* Defaults to zero on bad type */ + hb_parl( 7 ), /* Rest */ /* Defaults to zero on bad type */ + ISCHAR( 8 ) ? hb_parc( 8 ) : NULL ); /* RDD */ + } } HB_FUNC( __DBCOPY ) { - hb_retni( rddMoveRecords( NULL, // FROM current area - hb_parc( 1 ), // File To - ISNIL( 2 ) ? NULL : hb_param( 2, HB_IT_ARRAY ), // Fuelds - ISNIL( 3 ) ? NULL : hb_param( 3, HB_IT_BLOCK ), // For - ISNIL( 4 ) ? NULL : hb_param( 4, HB_IT_BLOCK ), // While - ISNIL( 5 ) ? 0 : hb_parni( 5 ), // Next - ISNIL( 6 ) ? 0 : hb_parni( 6 ), // Record - ISNIL( 7 ) ? 0 : hb_parnl( 7 ), // Rest - ISNIL( 8 ) ? NULL : hb_parc( 8 ) )); // RDD - + if( ISCHAR( 1 ) ) + { + rddMoveRecords( NULL, /* fro CURRENT Area */ + hb_parc( 1 ), /* To File */ + hb_param( 2, HB_IT_ARRAY ), /* Fields */ + hb_param( 3, HB_IT_BLOCK ), /* For */ + hb_param( 4, HB_IT_BLOCK ), /* While */ + hb_parnl( 5 ), /* Next */ /* Defaults to zero on bad type */ + hb_parnl( 6 ), /* Record */ /* Defaults to zero on bad type */ + hb_parl( 7 ), /* Rest */ /* Defaults to zero on bad type */ + ISCHAR( 8 ) ? hb_parc( 8 ) : NULL ); /* RDD */ + } }