diff options
Diffstat (limited to 'src/core/xbblockread.cpp')
-rwxr-xr-x | src/core/xbblockread.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/core/xbblockread.cpp b/src/core/xbblockread.cpp index 09076b1..7e2c5fc 100755 --- a/src/core/xbblockread.cpp +++ b/src/core/xbblockread.cpp @@ -50,10 +50,14 @@ xbBlockRead::~xbBlockRead(){ #ifdef XB_DEBUG_SUPPORT void xbBlockRead::DumpReadBlockInternals(){ + + xbUInt32 ulRecCnt; + dbf->GetRecordCnt( ulRecCnt ); + std::cout << "------- DumpBlockInternals ---------" << std::endl; std::cout << "Dflt Blk Size = [" << dbf->GetXbasePtr()->GetDefaultBlockReadSize() << "]" << std::endl; - std::cout << "Dbf Record Count = [" << dbf->GetRecordCount() << "]" << std::endl; + std::cout << "Dbf Record Count = [" << ulRecCnt << "]" << std::endl; std::cout << "Dbf Record Len = [" << dbf->GetRecordLen() << "]" << std::endl; std::cout << "ulBlkSize = [" << ulBlkSize << "]" << std::endl; std::cout << "ulMaxRecs = [" << ulMaxRecs << "]" << std::endl; @@ -136,7 +140,12 @@ xbInt16 xbBlockRead::GetBlockForRecNo( xbUInt32 ulRecNo ){ xbInt16 iErrorStop = 0; try{ - xbUInt32 ulDbfRecCnt = dbf->GetRecordCount(); + xbUInt32 ulDbfRecCnt; + + if(( iRc = dbf->GetRecordCnt( ulDbfRecCnt )) != XB_NO_ERROR ){ + iErrorStop = 100; + throw iRc; + } // calc to determine block number for the requested record, 0 based offset xbUInt32 ulBlockNo = (xbUInt32)(ulRecNo / ulMaxRecs); @@ -183,7 +192,6 @@ xbInt16 xbBlockRead::GetBlockForRecNo( xbUInt32 ulRecNo ){ return iRc; } - /************************************************************************/ //! @brief Get the current block size. /*! |