diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 7681a63228..e585c4019e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,6 +1,15 @@ +20000204-22:12 GMT+3 Alexander Kresin + * source/rdd/dbcmd.c + + added hb_rddGetCurrentWorkAreaPointer() function + + source/rtl/tools/dbftools.c + Some Clipper Tools compatible functions + * contrib/rdd_ads/ads1.c + * Bugs fixed related to lock/unlock + * Memo support added + 20000204-14:47 GMT+1 Victor Szakats * source/rtl/itemapi.c - ! hb_itemNew() fixed to set the item type *after* filling the item + ! hb_itemNew() fixed to set the item type *after* filling the item structure with zeros. It won't set the type at all when a param other than NULL was passed. * makewww.bat diff --git a/harbour/contrib/rdd_ads/ads1.c b/harbour/contrib/rdd_ads/ads1.c index 607ac59439..ea4a12349a 100644 --- a/harbour/contrib/rdd_ads/ads1.c +++ b/harbour/contrib/rdd_ads/ads1.c @@ -193,7 +193,7 @@ static ERRCODE adsBof( ADSAREAP pArea, BOOL * pBof ) { HB_TRACE(HB_TR_DEBUG, ("adsBof(%p, %p)", pArea, pBof)); - AdsAtBOF ( pArea->hTable, &(pArea->fBof) ); + AdsAtBOF ( pArea->hTable, (UNSIGNED16 *)&(pArea->fBof) ); * pBof = pArea->fBof; return SUCCESS; } @@ -202,7 +202,7 @@ static ERRCODE adsEof( ADSAREAP pArea, BOOL * pEof ) { HB_TRACE(HB_TR_DEBUG, ("adsEof(%p, %p)", pArea, pEof)); - AdsAtEOF( pArea->hTable, &(pArea->fEof) ); + AdsAtEOF( pArea->hTable, (UNSIGNED16 *)&(pArea->fEof) ); * pEof = pArea->fEof; return SUCCESS; } @@ -211,7 +211,7 @@ static ERRCODE adsFound( ADSAREAP pArea, BOOL * pFound ) { HB_TRACE(HB_TR_DEBUG, ("adsFound(%p, %p)", pArea, pFound)); - AdsIsFound( pArea->hTable, &(pArea->fFound) ); + AdsIsFound( pArea->hTable, (UNSIGNED16 *)&(pArea->fFound) ); * pFound = pArea->fFound; return SUCCESS; } @@ -427,6 +427,26 @@ static ERRCODE adsGetValue( ADSAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) else hb_itemPutL( pItem, FALSE ); break; + case 'M': + { + UNSIGNED8 szName[HARBOUR_MAX_RDD_FIELDNAME_LENGTH+1]; + UNSIGNED16 pusBufLen = HARBOUR_MAX_RDD_FIELDNAME_LENGTH; + UNSIGNED8 *pucBuf; + UNSIGNED32 pulLen; + + AdsGetFieldName( pArea->hTable, uiIndex, szName, &pusBufLen ); + AdsGetMemoLength( pArea->hTable, szName, &pulLen ); + if( pulLen > 0 ) + { + pucBuf = (UNSIGNED8*) hb_xgrab( pulLen ); + AdsGetString( pArea->hTable, szName, pucBuf, &pulLen, ADS_NONE ); + hb_itemPutCL( pItem, ( char * ) pucBuf, pulLen ); + hb_xfree( pucBuf ); + } + else + hb_itemPutC( pItem, "" ); + break; + } } return SUCCESS; @@ -485,8 +505,7 @@ static ERRCODE adsPutValue( ADSAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) uiCount = pField->uiLen; memcpy( szText, pItem->item.asString.value, uiCount ); memset( szText + uiCount, ' ', pField->uiLen - uiCount ); - res = AdsSetString ( pArea->hTable, szName, - pItem->item.asString.value, uiCount ); + AdsSetString ( pArea->hTable, szName, pItem->item.asString.value, uiCount ); bError = FALSE; } break; @@ -539,6 +558,16 @@ static ERRCODE adsPutValue( ADSAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) } break; + case 'M': + if( pItem->type & IT_STRING ) + { + uiCount = pItem->item.asString.length; + AdsSetString ( pArea->hTable, szName, + pItem->item.asString.value, uiCount ); + bError = FALSE; + } + break; + } if( bError ) @@ -865,7 +894,9 @@ static ERRCODE adsOrderInfo( ADSAREAP pArea, USHORT uiIndex, LPDBORDERINFO pOrde #define adsFilterText NULL #define adsSetFilter NULL #define adsSetLocate NULL +#define adsCompile NULL #define adsError NULL +#define adsEvalBlock NULL static ERRCODE adsRawLock( ADSAREAP pArea, USHORT uiAction, ULONG lRecNo ) { @@ -887,15 +918,25 @@ static ERRCODE adsRawLock( ADSAREAP pArea, USHORT uiAction, ULONG lRecNo ) break; case FILE_LOCK: + if( pArea->lpExtendInfo->fExclusive || pArea->lpDataInfo->fFileLocked ) + return SUCCESS; ulRetVal = AdsLockTable ( pArea->hTable ); if ( ulRetVal != AE_SUCCESS ) return FAILURE; + pArea->lpDataInfo->fFileLocked = TRUE; break; case FILE_UNLOCK: - ulRetVal = AdsUnlockTable ( pArea->hTable ); - if ( ulRetVal != AE_SUCCESS ) - return FAILURE; + if( pArea->lpExtendInfo->fExclusive ) + return TRUE; + hb_adsUnLockAllRecords( pArea ); + if( pArea->lpDataInfo->fFileLocked ) + { + ulRetVal = AdsUnlockTable ( pArea->hTable ); + if ( ulRetVal != AE_SUCCESS ) + return FAILURE; + pArea->lpDataInfo->fFileLocked = FALSE; + } break; } return SUCCESS; @@ -910,6 +951,8 @@ static ERRCODE adsLock( ADSAREAP pArea, LPDBLOCKINFO pLockInfo ) hb_adsUnLockAllRecords( pArea ); /* Get current record */ + AdsGetRecordNum( pArea->hTable, ADS_IGNOREFILTERS, + (UNSIGNED32 *)&(pArea->lpExtendInfo->ulRecNo) ); pLockInfo->itmRecID = pArea->lpExtendInfo->ulRecNo; } if( adsRawLock( pArea, pLockInfo->uiMethod, pLockInfo->itmRecID ) == SUCCESS ) @@ -972,7 +1015,7 @@ static ERRCODE adsReadDBHeader( ADSAREAP pArea ) break; case ADS_NUMERIC: pFieldInfo.uiType = 'N'; - AdsGetFieldDecimals( pArea->hTable, szName, &pulLength ); + AdsGetFieldDecimals( pArea->hTable, szName, (UNSIGNED16 *)&pulLength ); pFieldInfo.uiDec = ( USHORT ) pulLength; break; case ADS_LOGICAL: @@ -1054,7 +1097,9 @@ static RDDFUNCS adsTable = { adsBof, adsFilterText, adsSetFilter, adsSetLocate, + adsCompile, adsError, + adsEvalBlock, adsRawLock, adsLock, adsUnLock, diff --git a/harbour/source/rdd/dbcmd.c b/harbour/source/rdd/dbcmd.c index 49f7f598c4..98a786a560 100644 --- a/harbour/source/rdd/dbcmd.c +++ b/harbour/source/rdd/dbcmd.c @@ -405,7 +405,7 @@ static ERRCODE defEval( AREAP pArea, LPDBEVALINFO pEvalInfo ) } return SUCCESS; } - + if( !pEvalInfo->dbsci.fRest || !hb_itemGetL( pEvalInfo->dbsci.fRest ) ) SELF_GOTOP( pArea ); @@ -469,9 +469,9 @@ static ERRCODE defEvalBlock( AREAP pArea, PHB_ITEM pBlock ) return FAILURE; } - hb_vmPushSymbol( &hb_symEval ); + hb_vmPushSymbol( &hb_symEval ); hb_vmPush( pBlock ); - hb_vmDo( 0 ); + hb_vmDo( 0 ); if( !pArea->valResult ) pArea->valResult = hb_itemNew( NULL ); hb_itemCopy( pArea->valResult, &hb_stack.Return ); @@ -741,7 +741,7 @@ static ERRCODE defSkip( AREAP pArea, LONG lToSkip ) return SUCCESS; } } - + return SELF_SKIPRAW( pArea, lToSkip ); } @@ -1136,6 +1136,17 @@ ERRCODE hb_rddInherit( PRDDFUNCS pTable, PRDDFUNCS pSubTable, PRDDFUNCS pSuperTa return SUCCESS; } +/* + * Function for getting current workarea pointer + */ + +void* hb_rddGetCurrentWorkAreaPointer( void ) +{ + HB_TRACE(HB_TR_DEBUG, ("hb_rddGetCurrentWorkAreaPointer()")); + + return pCurrArea->pArea; +} + /* * -- FUNCTIONS ACCESSED FROM VIRTUAL MACHINE -- */ @@ -1423,7 +1434,7 @@ void hb_rddShutDown( void ) * of a file's structure.The first array will consist of the * names of the fields in the current work area.All other arrays * are optional and will be filled with the corrensponding data. - * This function will return zero if no parameters are specified + * This function will return zero if no parameters are specified * or if no database is avaliable in the current work area.Otherwise, * the number of fields or the lenght of the shortest array argument, * witchever is smaller, will be returned. @@ -1435,7 +1446,7 @@ void hb_rddShutDown( void ) * * dbGoTop() * nFields:=aFields(aNames,aTypes,aLens,aDecs) - * + * * ? "Number of fields", nFields * * RETURN NIL @@ -1540,7 +1551,7 @@ HARBOUR HB_AFIELDS( void ) * function DBF(), with is a strictly a compatibility function * $EXAMPLES$ * FUNCTION Main() - * + * * USE Test * * select 0 @@ -1711,7 +1722,7 @@ HARBOUR HB_DBEVAL( void ) * $SYNTAX$ * Dbf() --> * $ARGUMENTS$ - * + * * $RETURNS$ * Name of alias * $DESCRIPTION$ @@ -1720,7 +1731,7 @@ HARBOUR HB_DBEVAL( void ) * This function is the same as Alias() * $EXAMPLES$ * FUNCTION Main() - * + * * USE Test * * select 0 @@ -1771,7 +1782,7 @@ HARBOUR HB_DBF( void ) * $SYNTAX$ * BOF() --> * $ARGUMENTS$ - * + * * $RETURNS$ * Logical true (.T.) or false (.F.) * $DESCRIPTION$ @@ -1783,7 +1794,7 @@ HARBOUR HB_DBF( void ) * database unless the function is preceded by an alias * $EXAMPLES$ * FUNCTION Main() - * + * * USE Test * * qOut( BOF(),Recno()) @@ -1846,13 +1857,13 @@ HARBOUR HB_BOF( void ) * if made to LASTREC()+1,NETERR() will return a logical true (.T.) * immediately after the DBAPPEND() function. This function does * not unlock the locked records. - * If is passed a logical true (.T.) value, it will + * If is passed a logical true (.T.) value, it will * release the record locks, which allows the application to main- * tain multiple record locks during an appending operation. The * default for this parameter is a logical false (.F.). * $EXAMPLES$ * FUNCTION Main() - * + * * USE Test * local cName="HARBOUR",nId=10 * Test->(DbAppend()) @@ -1893,7 +1904,7 @@ HARBOUR HB_DBAPPEND( void ) * $SYNTAX$ * DbClearFilTer() -> NIL * $ARGUMENTS$ - * + * * $RETURNS$ * * $DESCRIPTION$ @@ -1940,7 +1951,7 @@ HARBOUR HB_DBCLEARFILTER( void ) * $SYNTAX$ * DbCloseAll() -> NIL * $ARGUMENTS$ - * + * * $RETURNS$ * DBCLOSEALL always return NIL * $DESCRIPTION$ @@ -1987,7 +1998,7 @@ HARBOUR HB_DBCLOSEALL( void ) * $SYNTAX$ * DbCloseArea() -> NIL * $ARGUMENTS$ - * + * * $RETURNS$ * * $DESCRIPTION$ @@ -2051,7 +2062,7 @@ HARBOUR HB_DBCLOSEAREA( void ) * $SYNTAX$ * DBCOMMIT() --> NIL * $ARGUMENTS$ - * + * * $RETURNS$ * DBCOMMIT() always returns NIL. * $DESCRIPTION$ @@ -2084,7 +2095,7 @@ HARBOUR HB_DBCLOSEAREA( void ) * $SEEALSO$ * DBCLOSEALL(),DBCOMMITALL(),DBUNLOCK() * $INCLUDE$ - * + * * $END$ */ @@ -2106,7 +2117,7 @@ HARBOUR HB_DBCOMMIT( void ) * $SYNTAX$ * DBCOMMIT() --> NIL * $ARGUMENTS$ - * + * * $RETURNS$ * DBCOMMIT() always returns NIL. * $DESCRIPTION$ @@ -2142,7 +2153,7 @@ HARBOUR HB_DBCOMMIT( void ) * $SEEALSO$ * DBCLOSEALL(),DBCOMMIT(),DBUNLOCK() * $INCLUDE$ - * + * * $END$ */ @@ -2168,7 +2179,7 @@ HARBOUR HB_DBCOMMITALL( void ) * $SYNTAX$ * __DbCONTINUE() -> NIL * $ARGUMENTS$ - * + * * $RETURNS$ * __DbCONTINUE() Always return nil * $DESCRIPTION$ @@ -2191,7 +2202,7 @@ HARBOUR HB_DBCOMMITALL( void ) * condition and want to continue the search for a matching record, use * SKIP and then repeat the original LOCATE statement adding REST as the * scope. - * + * * $EXAMPLES$ * This example scans records in Sales.dbf for a particular * salesman and displays a running total sales amounts: @@ -2229,7 +2240,7 @@ HARBOUR HB_DBCOMMITALL( void ) * $SEEALSO$ * EOF(),FOUND() * $INCLUDE$ - * + * * $END$ */ @@ -2275,7 +2286,7 @@ HARBOUR HB___DBCONTINUE() * Create a database file from a database structure array * $SYNTAX$ * DBCREATE(, ,[]) --> NIL - * + * * $ARGUMENTS$ * is the name of the new database file, with an optional * drive and directory, specified as a character string. If specified @@ -2299,7 +2310,7 @@ HARBOUR HB___DBCONTINUE() * process the current work area. is name of the RDD specified * as a character expression. If you specify as a literal value, * you must enclose it in quotes. - * + * * $RETURNS$ * DBCREATE() always returns NIL. * $DESCRIPTION$ @@ -2335,7 +2346,7 @@ HARBOUR HB___DBCONTINUE() * subarray more readable, the header file called Dbstruct.ch is supplied * which contains the #defines to assign a name to the array position for * each field attribute. It is located in \CLIPPER5\INCLUDE. - * + * * $EXAMPLES$ * This example creates an empty array and then adds field * definition subarrays using the AADD() function before creating @@ -2368,7 +2379,7 @@ HARBOUR HB___DBCONTINUE() * $STATUS$ * R * $COMPLIANCE$ - * + * * $SEEALSO$ * AFIELDS(),DBSTRUCT() * $INCLUDE$ @@ -2392,7 +2403,7 @@ HARBOUR HB_DBCREATE( void ) szFileName = hb_parc( 1 ); pStruct = hb_param( 2 , IT_ARRAY ); uiLen = hb_arrayLen( pStruct ); - + if( ( strlen( szFileName ) == 0 ) || !pStruct || uiLen == 0 ) { hb_errRT_DBCMD( EG_ARG, 1014, NULL, "DBCREATE" ); @@ -2662,7 +2673,7 @@ HARBOUR HB_DBCREATE( void ) * $SYNTAX$ * DBDELETE() --> NIL * $ARGUMENTS$ - * + * * $RETURNS$ * DBDELETE() always returns NIL. * $DESCRIPTION$ @@ -2684,11 +2695,11 @@ HARBOUR HB_DBCREATE( void ) * $TESTS$ * $STATUS$ * R - * $COMPLIANCE$ + * $COMPLIANCE$ * $SEEALSO$ - * DBRECALL() + * DBRECALL() * $INCLUDE$ - * + * * $END$ */ @@ -2710,7 +2721,7 @@ HARBOUR HB_DBDELETE( void ) * $SYNTAX$ * DBFILTER() --> cFilter * $ARGUMENTS$ - * + * * $RETURNS$ * DBFILTER() returns the filter expression. * $DESCRIPTION$ @@ -2724,8 +2735,8 @@ HARBOUR HB_DBDELETE( void ) * SET FILTER TO Id = 1 * SELECT Test * // - * ? DBFILTER() - * ? TestId->(DBFILTER()) + * ? DBFILTER() + * ? TestId->(DBFILTER()) * $TESTS$ * $STATUS$ * R @@ -2733,7 +2744,7 @@ HARBOUR HB_DBDELETE( void ) * $SEEALSO$ * DBRELATION(),DBRSELECT() * $INCLUDE$ - * + * * $END$ */ @@ -2762,7 +2773,7 @@ HARBOUR HB_DBFILTER( void ) * $SYNTAX$ * DBGOBOTTOM() --> NIL * $ARGUMENTS$ - * + * * $RETURNS$ * DBGOBOTTOM() always returns NIL. * $DESCRIPTION$ @@ -2785,7 +2796,7 @@ HARBOUR HB_DBFILTER( void ) * $SEEALSO$ * BOF(),EOF(),DBSKIP(),DBSEEK(),DBGOTOP() * $INCLUDE$ - * + * * $END$ */ @@ -2843,7 +2854,7 @@ HARBOUR HB_DBGOBOTTOM( void ) * $SEEALSO$ * BOF(),EOF(),DBGOTOP(),DBGOBOTTOM(),DBSEEK(),DBSKIP() * $INCLUDE$ - * + * * $END$ */ @@ -2874,7 +2885,7 @@ HARBOUR HB_DBGOTO( void ) * $SYNTAX$ * DBGOTOP() --> NIL * $ARGUMENTS$ - * + * * $RETURNS$ * DBGOTOP() always returns NIL. * This function moves the record pointer in the selected or aliased @@ -2896,7 +2907,7 @@ HARBOUR HB_DBGOTO( void ) * $SEEALSO$ * BOF(),EOF(),DBSKIP(),DBSEEK(),DBGOBOTTOM() * $INCLUDE$ - * + * * $END$ */ @@ -3154,14 +3165,14 @@ HARBOUR HB___DBPACK( void ) * $SYNTAX$ * DBRECALL() --> NIL * $ARGUMENTS$ - * + * * $RETURNS$ * DBRECALL() always returns NIL. * $DESCRIPTION$ * This function unmarks those records marked for deletion nd reactivates * them in the aliased or selected work area.If a record is DELETED and * the DELETED setting is on, the record will still be visible for a - * DBRECALL() provided that the database record pointer has not been + * DBRECALL() provided that the database record pointer has not been * skipped.Once a record marked for deletion with the DELETE setting ON * has been skipped, it no longer canbe brought back with DBRECALL(). * $EXAMPLES$ @@ -3179,7 +3190,7 @@ HARBOUR HB___DBPACK( void ) * $SEEALSO$ * DBDELETE() * $INCLUDE$ - * + * * $END$ */ @@ -3201,7 +3212,7 @@ HARBOUR HB_DBRECALL( void ) * $SYNTAX$ * DBRLOCK([]) --> lSuccess * $ARGUMENTS$ - * Record indetifier + * Record indetifier * $RETURNS$ * DBRLOCK() returns a logical true (.T.) if lock was successful * $DESCRIPTION$ @@ -3229,7 +3240,7 @@ HARBOUR HB_DBRECALL( void ) * $SEEALSO$ * DBUNLOCK(),DBUNLOCKALL(),FLOCK(),RLOCK() * $INCLUDE$ - * + * * $END$ */ @@ -3262,7 +3273,7 @@ HARBOUR HB_DBRLOCK( void ) * $ARGUMENTS$ * * $RETURNS$ - * DBRLOCKLIST() return a array of lock records + * DBRLOCKLIST() return a array of lock records * $DESCRIPTION$ * This function will return an array of locked records in a given * and active work area.If the return array is an empty array @@ -3292,7 +3303,7 @@ HARBOUR HB_DBRLOCK( void ) * $SEEALSO$ * RLOCK(),DBRLOCK(),DBRUNLOCK() * $INCLUDE$ - * + * * $END$ */ @@ -3327,7 +3338,7 @@ HARBOUR HB_DBRLOCKLIST( void ) * This function will attempt to unlock the record specified as * ,which in a .DBF format is the record number.If not * specified,them the current active record/data item will be - * unlocked + * unlocked * $EXAMPLES$ * FUNCTION Main() * USE Tests New @@ -3347,7 +3358,7 @@ HARBOUR HB_DBRLOCKLIST( void ) * $SEEALSO$ * RLOCK(),DBRLOCK(),DBRLOCKLIST() * $INCLUDE$ - * + * * $END$ */ @@ -3414,7 +3425,7 @@ HARBOUR HB_DBRUNLOCK( void ) * $SEEALSO$ * DBGOBOTTOM(),DBGOTOP(),DBSKIP(),EOF(),BOF(),FOUND() * $INCLUDE$ - * + * * $END$ */ @@ -3459,7 +3470,7 @@ HARBOUR HB_DBSEEK( void ) * * is a character value that specifies the alias of a * currently occupied work area being selected. - * + * * $RETURNS$ * DBSELECTAREA() always returns NIL. * $DESCRIPTION$ @@ -3512,7 +3523,7 @@ HARBOUR HB_DBSEEK( void ) * $SEEALSO$ * DBUSEAREA(),SELECT() * $INCLUDE$ - * + * * $END$ */ @@ -3576,7 +3587,7 @@ HARBOUR HB_DBSELECTAREA( void ) * $ARGUMENTS$ * is an optional character value that specifies the name of * the database driver that should be used to activate and manage new work - * areas when no driver is explicitly specified. + * areas when no driver is explicitly specified. * $RETURNS$ * DBSETDRIVER() returns the name of the current default driver. * $DESCRIPTION$ @@ -3584,7 +3595,7 @@ HARBOUR HB_DBSELECTAREA( void ) * work areas without specifying a driver. If the specified driver is not * available to the application, the call has no effect. DBSETDRIVER() * returns the name of the current default driver, if any. - * + * * $EXAMPLES$ * This example makes the "DBFNDX" driver the default driver. If * the driver is unavailable, a message is issued: @@ -3602,7 +3613,7 @@ HARBOUR HB_DBSELECTAREA( void ) * $SEEALSO$ * DBUSEAREA() * $INCLUDE$ - * + * * $END$ */ @@ -3649,12 +3660,12 @@ HARBOUR HB___DBSETFOUND( void ) * $ONELINER$ * Move relative to the current record * $SYNTAX$ - * DBSKIP([]) --> NIL + * DBSKIP([]) --> NIL * $ARGUMENTS$ * is the number of logical records to move, relative to the * current record. A positive value means to skip forward, and a negative * value means to skip backward. If is omitted, a value of 1 is - * assumed. + * assumed. * $RETURNS$ * DBSKIP() always returns NIL. * $DESCRIPTION$ @@ -3699,9 +3710,9 @@ HARBOUR HB___DBSETFOUND( void ) * $COMPLIANCE$ * * $SEEALSO$ - * BOF(),DBGOBOTTOM(),DBGOTOP(),DBSEEK(),EOF() + * BOF(),DBGOBOTTOM(),DBGOTOP(),DBSEEK(),EOF() * $INCLUDE$ - * + * * $END$ */ @@ -3735,7 +3746,7 @@ HARBOUR HB_DBSKIP( void ) * is an optional character value that expresses the * filter condition in textual form. If is omitted, the * DBSETFILTER() function will return an empty string for the work area. - * + * * $RETURNS$ * DBSETFILTER() always returns NIL. * $DESCRIPTION$ @@ -3793,7 +3804,7 @@ HARBOUR HB_DBSKIP( void ) * $SEEALSO$ * DBFILTER(),DBCLEARFILTER() * $INCLUDE$ - * + * * $END$ */ @@ -3832,7 +3843,7 @@ HARBOUR HB_DBSETFILTER( void ) * $SYNTAX$ * DBSTRUCT() --> aStruct * $ARGUMENTS$ - * + * * $RETURNS$ * DBSTRUCT() returns the structure of the current database file in an * array whose length is equal to the number of fields in the database @@ -3851,7 +3862,7 @@ HARBOUR HB_DBSETFILTER( void ) * * If there is no database file in USE in the current work area, DBSTRUCT() * returns an empty array ({}). - * + * * $DESCRIPTION$ * DBSTRUCT() is a database function that operates like COPY STRUCTURE * EXTENDED by creating an array of structure information rather than a @@ -3864,7 +3875,7 @@ HARBOUR HB_DBSETFILTER( void ) * * Note, a header file, Dbstruct.ch, located in \HARBOUR\INCLUDE contains * a series of manifest constants for each field attribute. - * + * * $EXAMPLES$ * This example opens two database files then creates an array * containing the database structure using DBSTRUCT() within an aliased @@ -3983,7 +3994,7 @@ HARBOUR HB_DBTABLEEXT( void ) * $SYNTAX$ * DBUNLOCK() --> NIL * $ARGUMENTS$ - * + * * $RETURNS$ * DBUNLOCK() always returns NIL. * $DESCRIPTION$ @@ -3997,8 +4008,8 @@ HARBOUR HB_DBTABLEEXT( void ) * Notes * * Network environment: Releasing locks may cause updates to the - * database to become visible to other processes. - * + * database to become visible to other processes. + * * $EXAMPLES$ * The following example illustrates a basic use of the * DBUNLOCK() function: @@ -4028,7 +4039,7 @@ HARBOUR HB_DBTABLEEXT( void ) * $SEEALSO$ * DBUNLOCKALL(),FLOCK(),RLOCK() * $INCLUDE$ - * + * * $END$ */ @@ -4050,7 +4061,7 @@ HARBOUR HB_DBUNLOCK( void ) * $SYNTAX$ * DBUNLOCKALL() --> NIL * $ARGUMENTS$ - * + * * $RETURNS$ * DBUNLOCKALL() always returns NIL. * $DESCRIPTION$ @@ -4061,7 +4072,7 @@ HARBOUR HB_DBUNLOCK( void ) * * DBUNLOCKALL() performs the same function as the UNLOCK ALL command. For * more information, refer to the UNLOCK ALL command. - * + * * $EXAMPLES$ * The following example marks a record for deletion if an * RLOCK() attempt is successful, then clears all locks in all work @@ -4100,7 +4111,7 @@ HARBOUR HB_DBUNLOCK( void ) * $SEEALSO$ * DBUNLOCK(),FLOCK(),RLOCK() * $INCLUDE$ - * + * * $END$ */ @@ -4125,7 +4136,7 @@ HARBOUR HB_DBUNLOCKALL( void ) * Use a database file in a work area * $SYNTAX$ * DBUSEAREA( [], [], , [], - * [], []) --> NIL + * [], []) --> NIL * $ARGUMENTS$ * is an optional logical value. A value of true (.T.) * selects the lowest numbered unoccupied work area as the current work @@ -4162,7 +4173,7 @@ HARBOUR HB_DBUNLOCKALL( void ) * prohibits updates; a value of false (.F.) permits updates. A value of * true (.T.) also permits read-only access to the specified database * (.dbf) file. If is omitted, the default value is false - * (.F.). + * (.F.). * $RETURNS$ * DBUSEAREA() always returns NIL. * $DESCRIPTION$ @@ -4179,7 +4190,7 @@ HARBOUR HB_DBUNLOCKALL( void ) * available to the application, the default driver is the driver * specified in the most recent call to DBSETDRIVER(). If DBSETDRIVER() * has not been called, the name of the default driver is undetermined. - * + * * $EXAMPLES$ * This example is a typical use of the DBUSEAREA() function: * @@ -4193,9 +4204,9 @@ HARBOUR HB_DBUNLOCKALL( void ) * * $SEEALSO$ * DBCLOSEAREA(),DBSETDRIVER(),SELECT(),SET() - * + * * $INCLUDE$ - * + * * $END$ */ @@ -4404,7 +4415,7 @@ HARBOUR HB_DBUSEAREA( void ) * $SYNTAX$ * __DbZap() -> NIL * $ARGUMENTS$ - * + * * $RETURNS$ * __DbZap() will always return nil * $DESCRIPTION$ @@ -4416,8 +4427,8 @@ HARBOUR HB_DBUSEAREA( void ) * almost instantaneous. * * To ZAP in a network environment, the current database file must be USEd - * EXCLUSIVEly. - * + * EXCLUSIVEly. + * * $EXAMPLES$ * This example demonstrates a typical ZAP operation in a network * environment: @@ -4438,9 +4449,9 @@ HARBOUR HB_DBUSEAREA( void ) * $COMPLIANCE$ * * $SEEALSO$ - * + * * $INCLUDE$ - * + * * $END$ */ @@ -4454,9 +4465,9 @@ HARBOUR HB_DBUSEAREA( void ) * $SYNTAX$ * ZAP * $ARGUMENTS$ - * + * * $RETURNS$ - * + * * $DESCRIPTION$ * ZAP is a database command that permanently removes all records from * files open in the current work area. This includes the current database @@ -4466,8 +4477,8 @@ HARBOUR HB_DBUSEAREA( void ) * instantaneous. * * To ZAP in a network environment, the current database file must be USEd - * EXCLUSIVEly. - * + * EXCLUSIVEly. + * * $EXAMPLES$ * This example demonstrates a typical ZAP operation in a network * environment: @@ -4488,9 +4499,9 @@ HARBOUR HB_DBUSEAREA( void ) * $COMPLIANCE$ * * $SEEALSO$ - * + * * $INCLUDE$ - * + * * $END$ */ @@ -4512,12 +4523,12 @@ HARBOUR HB___DBZAP( void ) * $SYNTAX$ * DELETED() --> lDeleted * $ARGUMENTS$ - * + * * $RETURNS$ * DELETED() returns true (.T.) if the current record is marked for * deletion; otherwise, it returns false (.F.). If there is no database * file in USE in the current work area, DELETED() returns false (.F.). - * + * * $DESCRIPTION$ * DELETED() is a database function that determines if the current record * in the active work area is marked for deletion. Since each work area @@ -4531,7 +4542,7 @@ HARBOUR HB___DBZAP( void ) * In applications, DELETED() is generally used to query the deleted status * as a part of record processing conditions, or to display the deleted * status as a part of screens and reports. - * + * * $EXAMPLES$ * This example uses DELETED() in the current and in an * unselected work area: @@ -4556,9 +4567,9 @@ HARBOUR HB___DBZAP( void ) * $COMPLIANCE$ * * $SEEALSO$ - * + * * $INCLUDE$ - * + * * $END$ */ @@ -4581,9 +4592,9 @@ HARBOUR HB_DELETED( void ) * $SYNTAX$ * EOF() --> * $ARGUMENTS$ - * + * * $RETURNS$ - * + * * EOF() returns true (.T.) when an attempt is made to move the record * pointer beyond the last logical record in a database file; otherwise, it * returns false (.F.). If there is no database file open in the current @@ -4678,11 +4689,11 @@ HARBOUR HB_EOF( void ) * $SYNTAX$ * FCOUNT() --> nFields * $ARGUMENTS$ - * + * * $RETURNS$ * FCOUNT() returns the number of fields in the database file in the * current work area as an integer numeric value. If there is no database - * file open, FCOUNT() returns zero. + * file open, FCOUNT() returns zero. * $DESCRIPTION$ * FCOUNT() is a database function. It is useful in applications * containing data-independent programs that can operate on any database @@ -4690,7 +4701,7 @@ HARBOUR HB_EOF( void ) * Typically, you use FCOUNT() to establish the upper limit of a FOR...NEXT * or DO WHILE loop that processes a single field at a time. * - * By default, FCOUNT() operates on the currently selected work area. + * By default, FCOUNT() operates on the currently selected work area. * $EXAMPLES$ * This example illustrates FCOUNT(), returning the number of * fields in the current and an unselected work area: @@ -4724,7 +4735,7 @@ HARBOUR HB_EOF( void ) * $SEEALSO$ * FIELDNAME(),TYPE() * $INCLUDE$ - * + * * $END$ */ @@ -4752,13 +4763,13 @@ HARBOUR HB_FCOUNT( void ) * $RETURNS$ * FIELDGET() returns the value of the specified field. If does * not correspond to the position of any field in the current database - * file, FIELDGET() returns NIL. + * file, FIELDGET() returns NIL. * $DESCRIPTION$ * FIELDGET() is a database function that retrieves the value of a field * using its position within the database file structure rather than its * field name. Within generic database service functions this allows, * among other things, the retrieval of field values without use of the - * macro operator. + * macro operator. * $EXAMPLES$ * This example compares FIELDGET() to functionally equivalent * code that uses the macro operator to retrieve the value of a field: @@ -4780,7 +4791,7 @@ HARBOUR HB_FCOUNT( void ) * $SEEALSO$ * FIELDPUT() * $INCLUDE$ - * + * * $END$ */ @@ -4815,7 +4826,7 @@ HARBOUR HB_FIELDGET( void ) * FIELDNAME() returns the name of the specified field as a character * string. If does not correspond to an existing field in the * current database file or if no database file is open in the current work - * area, FIELDNAME() returns a null string (""). + * area, FIELDNAME() returns a null string (""). * $DESCRIPTION$ * FIELDNAME() is a database function that returns a field name using an * index to the position of the field name in the database structure. Use @@ -4833,7 +4844,7 @@ HARBOUR HB_FIELDGET( void ) * * By default, FIELDNAME() operates on the currently selected work area as * shown in the example below. - * + * * $EXAMPLES$ * These examples illustrate FIELDNAME() used with several other * functions: @@ -4871,9 +4882,9 @@ HARBOUR HB_FIELDGET( void ) * * $SEEALSO$ * DBSTRUCT(),FCOUNT(),LEN(),VALTYPE() - * + * * $INCLUDE$ - * + * * $END$ */ @@ -4950,7 +4961,7 @@ HARBOUR HB_FIELDNAME( void ) * $SEEALSO$ * FIELDGET(),FIELDPUT() * $INCLUDE$ - * + * * $END$ */ @@ -4996,7 +5007,7 @@ HARBOUR HB_FIELDPOS( void ) * is the value to assign to the given field. The data * type of this expression must match the data type of the designated field * variable. - * $RETURNS$ + * $RETURNS$ * FIELDPUT() returns the value assigned to the designated field. If * does not correspond to the position of any field in the current * database file, FIELDPUT() returns NIL. @@ -5025,7 +5036,7 @@ HARBOUR HB_FIELDPOS( void ) * $SEEALSO$ * FIELDGET() * $INCLUDE$ - * + * * $END$ */ @@ -5057,13 +5068,13 @@ HARBOUR HB_FIELDPUT( void ) * $SYNTAX$ * FLOCK() --> lSuccess * $ARGUMENTS$ - * + * * $RETURNS$ * FLOCK() returns true (.T.) if an attempt to lock a database file in USE * in the current work area succeeds; otherwise, it returns false (.F.). * For more information on file locking, refer to the Network Programming * chapter in the Programming and Utilities guide. - * + * * $DESCRIPTION$ * FLOCK() is a database function used in network environments to lock an * open and shared database file, preventing other users from updating the @@ -5138,7 +5149,7 @@ HARBOUR HB_FIELDPUT( void ) * $SEEALSO$ * RLOCK() * $INCLUDE$ - * + * * $END$ */ @@ -5169,12 +5180,12 @@ HARBOUR HB_FLOCK( void ) * $SYNTAX$ * FOUND() --> lSuccess * $ARGUMENTS$ - * + * * $RETURNS$ * FOUND() returns true (.T.) if the last search command was successful; * otherwise, it returns false (.F.). - * - * $DESCRIPTION$ + * + * $DESCRIPTION$ * FOUND() is a database function that determines whether a search * operation (i.e., FIND, LOCATE, CONTINUE, SEEK, or SET RELATION) * succeeded. When any of these commands are executed, FOUND() is set to @@ -5244,7 +5255,7 @@ HARBOUR HB_FLOCK( void ) * $SEEALSO$ * EOF() * $INCLUDE$ - * + * * $END$ */ @@ -5267,12 +5278,12 @@ HARBOUR HB_FOUND( void ) * $SYNTAX$ * HEADER() --> nBytes * $ARGUMENTS$ - * + * * $RETURNS$ * HEADER() returns the number of bytes in the header of the current * database file as an integer numeric value. If no database file is in - * use, HEADER() returns a zero (0). - * $DESCRIPTION$ + * use, HEADER() returns a zero (0). + * $DESCRIPTION$ * HEADER() is a database function that is used with LASTREC(), RECSIZE(), * and DISKSPACE() to create procedures for backing up files. * @@ -5307,7 +5318,7 @@ HARBOUR HB_FOUND( void ) * $SEEALSO$ * DISKSPACE(),LASTREC(),RECSIZE() * $INCLUDE$ - * + * * $END$ */ @@ -5336,14 +5347,14 @@ HARBOUR HB_HEADER( void ) * $SYNTAX$ * INDEXORD() --> nOrder * $ARGUMENTS$ - * + * * $RETURNS$ * INDEXORD() returns an integer numeric value. The value returned is * equal to the position of the controlling index in the list of open * indexes for the current work area. A value of zero indicates that there * is no controlling index and records are being accessed in natural order. * If no database file is open, INDEXORD() will also return a zero. - * $DESCRIPTION$ + * $DESCRIPTION$ * INDEXORD() is a database function that determines the position of the * controlling index in the list of index files opened by the last * USE...INDEX or SET INDEX TO in the current work area. It is often @@ -5352,7 +5363,7 @@ HARBOUR HB_HEADER( void ) * By default, INDEXORD() operates on the currently selected work area. It * will operate on an unselected work area if you specify it as part of an * aliased expression (see example below). - * $EXAMPLES$ + * $EXAMPLES$ * This example uses INDEXORD() to save the current order. After * changing to a new order, it uses the saved value to restore the * original order: @@ -5379,7 +5390,7 @@ HARBOUR HB_HEADER( void ) * $SEEALSO$ * INDEXKEY() * $INCLUDE$ - * + * * $END$ */ @@ -5408,13 +5419,13 @@ HARBOUR HB_INDEXORD( void ) * $SYNTAX$ * LASTREC() | RECCOUNT()* --> nRecords * $ARGUMENTS$ - * - * $RETURNS$ + * + * $RETURNS$ * LASTREC() returns the number of physical records in the current database * file as an integer numeric value. Filtering commands such as SET FILTER * or SET DELETED have no effect on the return value. LASTREC() returns * zero if there is no database file in USE in the current work area. - * $DESCRIPTION$ + * $DESCRIPTION$ * LASTREC() is a database function that determines the number of physical * records in the current database file. LASTREC() is identical to * RECCOUNT() which is supplied as a compatibility function. @@ -5448,7 +5459,7 @@ HARBOUR HB_INDEXORD( void ) * $SEEALSO$ * EOF() * $INCLUDE$ - * + * * $END$ */ @@ -5484,13 +5495,13 @@ HARBOUR HB_LOCK( void ) * $SYNTAX$ * LUPDATE() --> dModification * $ARGUMENTS$ - * + * * $RETURNS$ * LUPDATE() returns the date of last change to the open database file in * the current work area. If there is no database file in USE, LUPDATE() * returns a blank date. - * - * $DESCRIPTION$ + * + * $DESCRIPTION$ * LUPDATE() is a database function that determines the date the database * file in the current work area was last modified and CLOSEd. By default, * LUPDATE() operates on the currently selected work area. It will operate @@ -5526,7 +5537,7 @@ HARBOUR HB_LOCK( void ) * $SEEALSO$ * FIELDNAME(),LASTREC(),RECSIZE() * $INCLUDE$ - * + * * $END$ */ @@ -5553,12 +5564,12 @@ HARBOUR HB_LUPDATE( void ) * Setting NETERR() to a specified value allows the runtime error handler * to control the way certain file errors are handled. For more * information, refer to Errorsys.prg. - * - * $RETURNS$ + * + * $RETURNS$ * NETERR() returns true (.T.) if a USE or APPEND BLANK fails. The initial * value of NETERR() is false (.F.). If the current process is not running * under a network operating system, NETERR() always returns false (.F.). - * $DESCRIPTION$ + * $DESCRIPTION$ * NETERR() is a network function. It is a global flag set by USE, * USE...EXCLUSIVE, and APPEND BLANK in a network environment. It is used * to test whether any of these commands have failed by returning true @@ -5602,7 +5613,7 @@ HARBOUR HB_LUPDATE( void ) * $SEEALSO$ * FLOCK(),RLOCK() * $INCLUDE$ - * + * * $END$ */ @@ -5624,7 +5635,7 @@ HARBOUR HB_NETERR( void ) * $SYNTAX$ * ORDBAGEXT() --> cBagExt * $ARGUMENTS$ - * + * * $RETURNS$ * ORDBAGEXT() returns a character expression. * $DESCRIPTION$ @@ -5634,7 +5645,7 @@ HARBOUR HB_NETERR( void ) * current work area. * * ORDBAGEXT() supersedes the INDEXEXT() and is not recommended. - * + * * $EXAMPLES$ * USE sample VIA "DBFNTX" * ? ORDBAGEXT() // Returns .ntx @@ -5648,7 +5659,7 @@ HARBOUR HB_NETERR( void ) * $SEEALSO$ * INDEXEXT(),ORDBAGNAME() * $INCLUDE$ - * + * * $END$ */ @@ -5718,11 +5729,11 @@ HARBOUR HB_ORDBAGEXT( void ) * * is a character string that represents the name of the * target Order whose Order Bag name is sought. - * - * $RETURNS$ + * + * $RETURNS$ * ORDBAGNAME() returns a character string, the Order Bag name of the * specific Order. - * $DESCRIPTION$ + * $DESCRIPTION$ * ORDBAGNAME() is an Order management function that lets you access the * name of the Order Bag in which resides. You may identify * the Order as a character string or with an integer that represents its @@ -5756,7 +5767,7 @@ HARBOUR HB_ORDBAGEXT( void ) * $SEEALSO$ * ORDBAGEXT() * $INCLUDE$ - * + * * $END$ */ @@ -5815,9 +5826,9 @@ HARBOUR HB_ORDBAGNAME( void ) * next record is processed.Duplicate keys values are not added to the * index file when a FOR condition is Used. * $RETURNS$ - * + * * $DESCRIPTION$ - * + * * $EXAMPLES$ * * $TESTS$ @@ -5827,9 +5838,9 @@ HARBOUR HB_ORDBAGNAME( void ) * $COMPLIANCE$ * ORDCONDSET() is CA-CLIPPER 5.3 Compilant * $SEEALSO$ - * + * * $INCLUDE$ - * + * * $END$ */ @@ -5860,7 +5871,7 @@ HARBOUR HB_ORDCONDSET( void ) } else pOrderCondInfo->itmCobFor = NULL; - if( ISLOG( 3 ) ) + if( ISLOG( 3 ) ) pOrderCondInfo->fAll = hb_parl( 3 ); else pOrderCondInfo->fAll = TRUE; @@ -5910,7 +5921,7 @@ HARBOUR HB_ORDCONDSET( void ) * $SYNTAX$ * ORDCREATE(,[], , * [], []) --> NIL - * $ARGUMENTS$ + * $ARGUMENTS$ * is the name of a disk file containing one or more * Orders. You may specify as the filename with or without * the pathname or extension. If you do not include the extension as part @@ -5936,7 +5947,7 @@ HARBOUR HB_ORDCONDSET( void ) * global _SET_UNIQUE setting is used. * $RETURNS$ * ORDCREATE() always returns NIL. - * $DESCRIPTION$ + * $DESCRIPTION$ * ORDCREATE() is an Order management function that creates an Order in the * current work area. It works like DBCREATEINDEX() except that it lets * you create Orders in RDDs that recognize multiple-Order Bags. @@ -6003,7 +6014,7 @@ HARBOUR HB_ORDCONDSET( void ) * $SEEALSO$ * DBCREATEINDEX() * $INCLUDE$ - * + * * $END$ */ @@ -6051,8 +6062,8 @@ HARBOUR HB_ORDCREATE( void ) * Orders. You may specify as the filename with or without * the pathname or appropriate extension. If you do not include the * extension as part of HARBOUR uses the default - * extension of the current RDD. - * $RETURNS$ + * extension of the current RDD. + * $RETURNS$ * ORDDESTROY() always returns NIL. * $DESCRIPTION$ * ORDDESTROY() is an Order management function that removes a specified @@ -6082,7 +6093,7 @@ HARBOUR HB_ORDCREATE( void ) * $SEEALSO$ * ORDCREATE() * $INCLUDE$ - * + * * $END$ */ @@ -6110,8 +6121,8 @@ HARBOUR HB_ORDDESTROY( void ) * $SYNTAX$ * ORDFOR( | * [, ]) --> cForExp - * - * $ARGUMENTS$ + * + * $ARGUMENTS$ * is the name of the target Order, whose cForExp is * sought. * @@ -6123,14 +6134,14 @@ HARBOUR HB_ORDDESTROY( void ) * the pathname or appropriate extension. If you do not include the * extension as part of HARBOUR uses the default * extension of the current RDD. - * $RETURNS$ + * $RETURNS$ * ORDFOR() returns a character expression, cForExp, that represents the * FOR condition of the specified Order. If the Order was not created * using the FOR clause the return value will be an empty string (""). If * the database driver does not support the FOR condition, it may either * return an empty string ("") or raise an "unsupported function" error, * depending on the driver. - * $DESCRIPTION$ + * $DESCRIPTION$ * ORDFOR() is an Order management function that returns the character * string, cForExp, that represents the logical FOR condition of the Order, * or . @@ -6152,7 +6163,7 @@ HARBOUR HB_ORDDESTROY( void ) * $SEEALSO$ * ORDKEY(),ORDCREATE(),ORDNAME(),ORDNUMBER() * $INCLUDE$ - * + * * $END$ */ @@ -6187,10 +6198,10 @@ HARBOUR HB_ORDFOR( void ) * Data Base * $ONELINER$ * Return the key expression of an Order - * $SYNTAX$ + * $SYNTAX$ * ORDKEY( | * [, ]) --> cExpKey - * $ARGUMENTS$ + * $ARGUMENTS$ * is the name of an Order, a logical ordering of a * database. * @@ -6202,7 +6213,7 @@ HARBOUR HB_ORDFOR( void ) * the pathname or appropriate extension. If you do not include the * extension as part of HARBOUR uses the default * extension of the current RDD. - * $RETURNS$ + * $RETURNS$ * Returns a character string, cExpKey. * $DESCRIPTION$ * ORDKEY() is an Order management function that returns a character @@ -6235,7 +6246,7 @@ HARBOUR HB_ORDFOR( void ) * $SEEALSO$ * ORDFOR(),ORDNAME(),ORDNUMBER() * $INCLUDE$ - * + * * $END$ */ @@ -6270,10 +6281,10 @@ HARBOUR HB_ORDKEY( void ) * Data Base * $ONELINER$ * Add Orders to the Order List - * $SYNTAX$ + * $SYNTAX$ * ORDLISTADD( * [, ]) --> NIL - * $ARGUMENTS$ + * $ARGUMENTS$ * is the name of a disk file containing one or more * Orders. You may specify as the filename with or without * the pathname or appropriate extension. If you do not include the @@ -6284,14 +6295,14 @@ HARBOUR HB_ORDKEY( void ) * added to the Order List of the current work area. If you do not specify * , all orders in the Order Bag are added to the Order List of * the current work area. - * $RETURNS$ + * $RETURNS$ * ORDLISTADD() always returns NIL. * $DESCRIPTION$ * ORDLISTADD() is an Order management function that adds the contents of * an Order Bag , or a single Order in an Order Bag, to the Order List. * This function lets you extend the Order List without issuing a SET INDEX * command that, first, clears all the active Orders from the Order List. - * + * * Any Orders already associated with the work area continue to be active. * If the newly opened Order Bag contains the only Order associated with * the work area, it becomes the controlling Order; otherwise, the @@ -6329,7 +6340,7 @@ HARBOUR HB_ORDKEY( void ) * $SEEALSO$ * DBSETINDEX() * $INCLUDE$ - * + * * $END$ */ @@ -6362,7 +6373,7 @@ HARBOUR HB_ORDLISTADD( void ) * $SYNTAX$ * ORDLISTCLEAR() --> NIL * $ARGUMENTS$ - * + * * $RETURNS$ * ORDLISTCLEAR() always returns NIL. * $DESCRIPTION$ @@ -6371,7 +6382,7 @@ HARBOUR HB_ORDLISTADD( void ) * done, the Order List is empty. * * This function supersedes the function DBCLEARINDEX(). - * + * * $EXAMPLES$ * USE Sales NEW * SET INDEX TO SaRegion, SaRep, SaCode @@ -6388,10 +6399,10 @@ HARBOUR HB_ORDLISTADD( void ) * $SEEALSO$ * DBCLEARINDEX() * $INCLUDE$ - * + * * $END$ */ - + HARBOUR HB_ORDLISTCLEAR( void ) { if( pCurrArea ) @@ -6410,7 +6421,7 @@ HARBOUR HB_ORDLISTCLEAR( void ) * $SYNTAX$ * ORDLISTREBUILD() --> NIL * $ARGUMENTS$ - * + * * $RETURNS$ * ORDLISTREBUILD() always returns NIL. * $DESCRIPTION$ @@ -6421,7 +6432,7 @@ HARBOUR HB_ORDLISTCLEAR( void ) * * Unlike ORDCREATE(), this function rebuilds all Orders in the Order List. * It is equivalent to REINDEX. - * + * * $EXAMPLES$ * USE Customer NEW * SET INDEX TO CuAcct, CuName, CuZip @@ -6437,7 +6448,7 @@ HARBOUR HB_ORDLISTCLEAR( void ) * $SEEALSO$ * ORDCREATE() * $INCLUDE$ - * + * * $END$ */ @@ -6459,7 +6470,7 @@ HARBOUR HB_ORDLISTREBUILD( void ) * $SYNTAX$ * ORDNAME([,]) * --> cOrderName - * $ARGUMENTS$ + * $ARGUMENTS$ * is an integer that identifies the position in the Order * List of the target Order whose database name is sought. * @@ -6468,10 +6479,10 @@ HARBOUR HB_ORDLISTREBUILD( void ) * the pathname or appropriate extension. If you do not include the * extension as part of HARBOUR uses the default * extension of the current RDD. - * $RETURNS$ + * $RETURNS$ * ORDNAME() returns the name of the specified Order in the current Order * List or the specified Order Bag if opened in the Current Order list. - * $DESCRIPTION$ + * $DESCRIPTION$ * ORDNAME() is an Order management function that returns the name of the * specified Order in the current Order List. * @@ -6507,7 +6518,7 @@ HARBOUR HB_ORDLISTREBUILD( void ) * $SEEALSO$ * ORDFOR(),ORDKEY(),ORDNUMBER() * $INCLUDE$ - * + * * $END$ */ @@ -6542,8 +6553,8 @@ HARBOUR HB_ORDNAME( void ) * Return the position of an Order in the current Order List * $SYNTAX$ * ORDNUMBER( - * [, ]) --> nOrderNo - * $ARGUMENTS$ + * [, ]) --> nOrderNo + * $ARGUMENTS$ * the name of the specific Order whose position in the * Order List is sought. * @@ -6552,10 +6563,10 @@ HARBOUR HB_ORDNAME( void ) * the pathname or appropriate extension. If you do not include the * extension as part of HARBOUR uses the default * extension of the current RDD. - * $RETURNS$ + * $RETURNS$ * Returns nOrderNo, an integer that represents the position of the * specified Order in the Order List. - * $DESCRIPTION$ + * $DESCRIPTION$ * ORDNUMBER() is an Order management function that lets you determine the * position in the current Order List of the specified Order. ORDNUMBER() * searches the Order List in the current work area and returns the @@ -6583,7 +6594,7 @@ HARBOUR HB_ORDNAME( void ) * $SEEALSO$ * INDEXORD() * $INCLUDE$ - * + * * $END$ */ @@ -6619,8 +6630,8 @@ HARBOUR HB_ORDNUMBER( void ) * $SYNTAX$ * ORDSETFOCUS([ | ] * [,]) --> cPrevOrderNameInFocus - * - * $ARGUMENTS$ + * + * $ARGUMENTS$ * is the name of the selected Order, a logical ordering * of a database. ORDSETFOCUS() ignores any invalid values of * . @@ -6635,7 +6646,7 @@ HARBOUR HB_ORDNUMBER( void ) * extension of the current RDD. * $RETURNS$ * ORDSETFOCUS() returns the Order Name of the previous controlling Order. - * $DESCRIPTION$ + * $DESCRIPTION$ * ORDSETFOCUS() is an Order management function that returns the Order * Name of the previous controlling Order and optionally sets the focus to * an new Order. @@ -6666,9 +6677,9 @@ HARBOUR HB_ORDNUMBER( void ) * $COMPLIANCE$ * * $SEEALSO$ - * + * * $INCLUDE$ - * + * * $END$ */ @@ -6700,7 +6711,7 @@ HARBOUR HB_ORDSETFOCUS( void ) * Return an array of the available Replaceable Database Drivers * $SYNTAX$ * RDDLIST([]) --> aRDDList - * $ARGUMENTS$ + * $ARGUMENTS$ * is an integer that represents the type of the RDD you * wish to list. The constants RDT_FULL and RDT_TRANSFER represent the two * types of RDDs currently available. @@ -6721,10 +6732,10 @@ HARBOUR HB_ORDSETFOCUS( void ) * drivers to open a file in a work area. The SDF and DELIM drivers are * examples of this type of RDD. They are only used in the implementation * of APPEND FROM and COPY TO with SDF or DELIMITED files. - * $RETURNS$ + * $RETURNS$ * RDDLIST() returns a one-dimensional array of the RDD names registered * with the application as . - * $DESCRIPTION$ + * $DESCRIPTION$ * RDDLIST() is an RDD function that returns a one-dimensional array that * lists the available RDDs. * @@ -6760,7 +6771,7 @@ HARBOUR HB_ORDSETFOCUS( void ) * $COMPLIANCE$ * * $SEEALSO$ - * + * * $INCLUDE$ * RDDSYS.CH * $END$ @@ -6796,11 +6807,11 @@ HARBOUR HB_RDDLIST( void ) * $SYNTAX$ * RDDNAME() --> cRDDName * $ARGUMENTS$ - * - * $RETURNS$ + * + * $RETURNS$ * Returns a character string, cRDDName, the registered name of the active * RDD in the current or specified work area. - * $DESCRIPTION$ + * $DESCRIPTION$ * RDDNAME() is an RDD function that returns a character string, cRDDName, * the name of the active RDD in the current or specified work area. * @@ -6822,7 +6833,7 @@ HARBOUR HB_RDDLIST( void ) * $SEEALSO$ * RDDLIST() * $INCLUDE$ - * + * * $END$ */ @@ -6878,16 +6889,16 @@ HARBOUR HB_RDDREGISTER( void ) * $SYNTAX$ * RDDSETDEFAULT([]) * --> cPreviousDefaultRDD - * - * $ARGUMENTS$ + * + * $ARGUMENTS$ * is a character string, the name of the RDD that is * to be made the new default RDD in the application. - * $RETURNS$ + * $RETURNS$ * RDDSETDEFAULT() returns a character string, cPreviousDefaultRDD, the * name of the previous default driver. The default driver is the driver * that HARBOUR uses if you do not explicitly specify an RDD with the * VIA clause of the USE command. - * $DESCRIPTION$ + * $DESCRIPTION$ * RDDSETDEFAULT() is an RDD function that sets or returns the name of the * previous default RDD driver and, optionally, sets the current driver to * the new RDD driver specified by cNewDefaultRDD. If @@ -6910,7 +6921,7 @@ HARBOUR HB_RDDREGISTER( void ) * $SEEALSO$ * DBSETDRIVER() * $INCLUDE$ - * + * * $END$ */ @@ -6948,15 +6959,15 @@ HARBOUR HB_RDDSETDEFAULT( void ) * $SYNTAX$ * RECCOUNT()* | LASTREC() --> nRecords * $ARGUMENTS$ - * + * * $RETURNS$ * RECCOUNT() returns the number of physical records in the current * database file as an integer numeric value. Filtering commands such as * SET FILTER or SET DELETED have no effect on the return value. * RECCOUNT() returns zero if there is no database file open in the current * work area. - * - * $DESCRIPTION$* + * + * $DESCRIPTION$* * RECCOUNT() is a database function that is a synonym for LASTREC(). By * default, RECCOUNT() operates on the currently selected work area. It * will operate on an unselected work area if you specify it as part of an @@ -6988,7 +6999,7 @@ HARBOUR HB_RDDSETDEFAULT( void ) * $SEEALSO$ * EOF(),LASTREC() * $INCLUDE$ - * + * * $END$ */ @@ -7014,11 +7025,11 @@ HARBOUR HB_RECCOUNT( void ) * $SYNTAX$ * RECNO() --> Identity * $ARGUMENTS$ - * - * $RETURNS$ + * + * $RETURNS$ * RECNO() returns the identity found at the position of the record * pointer. - * $DESCRIPTION$ + * $DESCRIPTION$ * RECNO() is a database function that returns the identity found at the * current position of the record pointer. Identity is a unique value * guaranteed by the structure of the data file to reference a specific @@ -7047,7 +7058,7 @@ HARBOUR HB_RECCOUNT( void ) * $SEEALSO$ * DBGOTO() * $INCLUDE$ - * + * * $END$ */ @@ -7072,12 +7083,12 @@ HARBOUR HB_RECNO( void ) * $SYNTAX$ * RECSIZE() --> nBytes * $ARGUMENTS$ - * - * $RETURNS$ + * + * $RETURNS$ * RECSIZE() returns, as a numeric value, the record length, in bytes, of * the database file open in the current work area. RECSIZE() returns zero * if no database file is open. - * $DESCRIPTION$ + * $DESCRIPTION$ * RECSIZE() is a database function that determines the length of a record * by summing the lengths of each field then adding one for the DELETED() * status flag. When this value is multiplied by LASTREC(), the product is @@ -7115,7 +7126,7 @@ HARBOUR HB_RECNO( void ) * $SEEALSO$ * DISKSPACE(),FIELDNAME(),HEADER(),LASTREC() * $INCLUDE$ - * + * * $END$ */ @@ -7144,11 +7155,11 @@ HARBOUR HB_RECSIZE( void ) * $SYNTAX$ * RLOCK() --> lSuccess * $ARGUMENTS$ - * - * $RETURNS$ + * + * $RETURNS$ * RLOCK() returns true (.T.) if the record lock is obtained; otherwise, it * returns false (.F.). - * $DESCRIPTION$ + * $DESCRIPTION$ * RLOCK() is a network function that locks the current record, preventing * other users from updating the record until the lock is released. * RLOCK() provides a shared lock, allowing other users read-only access to @@ -7221,7 +7232,7 @@ HARBOUR HB_RECSIZE( void ) * $SEEALSO$ * FLOCK() * $INCLUDE$ - * + * * $END$ */ @@ -7257,10 +7268,10 @@ HARBOUR HB_RLOCK( void ) * SELECT([]) --> nWorkArea * $ARGUMENTS$ * is the target work area alias name. - * $RETURNS$ + * $RETURNS$ * SELECT() returns the work area of the specified alias as a integer * numeric value. - * $DESCRIPTION$ + * $DESCRIPTION$ * SELECT() is a database function that determines the work area number of * an alias. The number returned can range from zero to 250. If * is not specified, the current work area number is returned. If @@ -7294,7 +7305,7 @@ HARBOUR HB_RLOCK( void ) * $SEEALSO$ * ALIAS(),USED() * $INCLUDE$ - * + * * $END$ */ @@ -7324,11 +7335,11 @@ HARBOUR HB_SELECT( void ) * $SYNTAX$ * USED() --> lDbfOpen * $ARGUMENTS$ - * - * $RETURNS$ + * + * $RETURNS$ * USED() returns true (.T.) if there is a database file in USE; otherwise, * it returns false (.F.). - * $DESCRIPTION$ + * $DESCRIPTION$ * USED() is a database function that determines whether there is a * database file in USE in a particular work area. By default, USED() * operates on the currently selected work area. It will operate on an @@ -7350,7 +7361,7 @@ HARBOUR HB_SELECT( void ) * $SEEALSO$ * ALIAS(),SELECT() * $INCLUDE$ - * + * * $END$ */ @@ -7374,16 +7385,16 @@ HARBOUR HB_USED( void ) * $SYNTAX$ * __RDDSETDEFAULT([]) * --> cPreviousDefaultRDD - * - * $ARGUMENTS$ + * + * $ARGUMENTS$ * is a character string, the name of the RDD that is * to be made the new default RDD in the application. - * $RETURNS$ + * $RETURNS$ * __RDDSETDEFAULT() returns a character string, cPreviousDefaultRDD, the * name of the previous default driver. The default driver is the driver * that HARBOUR uses if you do not explicitly specify an RDD with the * VIA clause of the USE command. - * $DESCRIPTION$ + * $DESCRIPTION$ * RDDSETDEFAULT() is an RDD function that sets or returns the name of the * previous default RDD driver and, optionally, sets the current driver to * the new RDD driver specified by cNewDefaultRDD. If @@ -7406,7 +7417,7 @@ HARBOUR HB_USED( void ) * $SEEALSO$ * DBSETDRIVER() * $INCLUDE$ - * + * * $END$ */ diff --git a/harbour/source/tools/dbftools.c b/harbour/source/tools/dbftools.c new file mode 100644 index 0000000000..38ac92fe31 --- /dev/null +++ b/harbour/source/tools/dbftools.c @@ -0,0 +1,82 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * Some dbf structure related functions + * + * Copyright 2000 Alexander Kresin + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version, with one exception: + * + * The exception is that if you link the Harbour Runtime Library (HRL) + * and/or the Harbour Virtual Machine (HVM) with other files to produce + * an executable, this does not by itself cause the resulting executable + * to be covered by the GNU General Public License. Your use of that + * executable is in no way restricted on account of linking the HRL + * and/or HVM code into it. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit + * their web site at http://www.gnu.org/). + * + */ + +#include "windows.h" +#include "extend.h" +#include "init.h" +#include "itemapi.h" +#include "rddsys.ch" +#include "langapi.h" +#include "dates.h" +#include "errorapi.h" +#include "rddapi.h" + +extern void* hb_rddGetCurrentWorkAreaPointer( void ); + +HARBOUR HB_FIELDTYPE( void ) +{ + USHORT uiField; + LPFIELD pField; + AREAP pArea; + + uiField = hb_parni( 1 ); + pArea = (AREAP) hb_rddGetCurrentWorkAreaPointer(); + pField = pArea->lpFields + uiField - 1; + hb_retc( (char*) &(pField->uiType) ); +} + +HARBOUR HB_FIELDSIZE( void ) +{ + USHORT uiField; + LPFIELD pField; + AREAP pArea; + + uiField = hb_parni( 1 ); + pArea = (AREAP) hb_rddGetCurrentWorkAreaPointer(); + pField = pArea->lpFields + uiField - 1; + hb_retni( pField->uiLen ); +} + +HARBOUR HB_FIELDDECI( void ) +{ + USHORT uiField; + LPFIELD pField; + AREAP pArea; + + uiField = hb_parni( 1 ); + pArea = (AREAP) hb_rddGetCurrentWorkAreaPointer(); + pField = pArea->lpFields + uiField - 1; + hb_retni( pField->uiDec ); +} \ No newline at end of file