diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-08-14 19:45:36 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-08-14 19:45:36 +0200 |
commit | bfa452a375ea0a0a3f95304a69186936567e5263 (patch) | |
tree | aade062a143c1afcc4ea06ee27905ffc34a9217b /docs/html/xbc15.html | |
parent | dd70ff8bf32c2d7ed365004b1770058265db1978 (diff) |
New upstream version 4.1.4
Diffstat (limited to 'docs/html/xbc15.html')
-rwxr-xr-x | docs/html/xbc15.html | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/docs/html/xbc15.html b/docs/html/xbc15.html deleted file mode 100755 index fde33b8..0000000 --- a/docs/html/xbc15.html +++ /dev/null @@ -1,96 +0,0 @@ - -<!DOCTYPE HTML PUBLIC> -<HTML> -<TITLE>Xbase DBMS Chapter 15</TITLE> -<BODY BGCOLOR=#FFFFFF> -<H2><p align="center">Block Read Functionality</p></H2> -<p align="center">Chapter Updated 2/1/23</p><hr> - - -<h3>Block Reads</h3> - -As of release 4.1.1, the Xbase library includes functionality for reading a DBF file in blocks, rather than one record at a time.<br><br> - -This functionality can be used to improve application performance in situations where a data file is being read sequentially. -For situations where records are retrieved randomly from the file, enabling this probably won't help much. In short, this -can be turned on when accessing a file sequentially and should be left off when not processing sequentially.<br><br> - -The logic is all handled internally within the library, all that is needed is to enable it and the library handles the rest.<br><br> - -<h3>One Caveat</h3> -This functionality was originally designed with reporting in mind and doesn't currently have any auto locking associated with it. -<br><br> - - -<h3>Sample Code</h3> -See example code below for how to enable and disable the feature. - - -<hr> - -#include "xbase.h"<br> -using namespace xb;<br> -<br> -int main(int ac,char** av)<br> -{<br> - xbXBase x;<br> - xbInt16 iRc;<br> - x.EnableMsgLogging();<br> - x.SetLogSize( 1000000L );<br> -<br> - if (ac <= 1) {<br> - std::cout << "Usage: xb_dumprecs filename..." << std::endl;<br> - return 1;<br> - }<br> -<br> - xbDbf *MyFile = NULL;<br> - if(( iRc = x.OpenHighestVersion( av[1], "", &MyFile )) != XB_NO_ERROR ){<br> - std::cout << "Could not open file iRc = " << iRc << " file = " << av[1] << std::endl;<br> - x.DisplayError( iRc );<br> - return 0;<br> - }<br> -<br> -// std::cout << "Processing file sequentially from beginning..." << std::endl;<br> -<br> -<br> -<b> - // turn on Block Read Processing<br> - #ifdef XB_BLOCKREAD_SUPPORT<br> - MyFile->EnableBlockReadProcessing();<br> - #endif<br> -</b> -<br> - xbUInt32 j = 0;<br> - xbUInt32 ulRecCnt = 0;<br> -<br> - iRc = MyFile->GetRecordCnt( ulRecCnt );<br> -<br> - if( iRc < XB_NO_ERROR )<br> - return iRc;<br> - while( j < ulRecCnt ){<br> - if( j == 0 )<br> - iRc = MyFile->DumpRecord(++j, 2, 2 );<br> - else<br> - iRc = MyFile->DumpRecord(++j, 2, 1 );<br> - if( iRc != XB_NO_ERROR ){<br> - x.DisplayError( iRc );<br> - return 1;<br> - }<br> - }<br> - std::cout << j << " Records processed." << std::endl;<br> -<br> -<br><b> - // optionally turn off Block Read Processing<br> - #ifdef XB_BLOCKREAD_SUPPORT<br> - MyFile->DisableBlockReadProcessing();<br> - #endif<br></b> -<br> - MyFile->Close();<br> - return 0;<br> -}<br> -<br> - -<hr> -<p><img src="xbase.jpg"><hr> -</BODY> -</HTML> |