xHarbour Reference Documentation > Command Reference |
Defines the default block size for memo files.
SET MEMOBLOCK TO <nBlockSize>
The SET MEMOBLOCK command defines the memo block size for RDDs that support variable block sizes for memo fields. The block size is the minimum amount of space allocated in memo files when storing character strings in memo fields. When large strings are stored in memo fields, they occupy the number of Int( Len(cString)/<nBlockSize> ) plus one blocks in the memo file.
The initial memo block size depends on the replaceable database driver used to open a database in a work area. The following table lists the default sizes for memo blocks of RDDs shipped with xHarbour:
Default memo block sizes
Memo type | Block size | Changeable |
---|---|---|
DBT | 512 | No |
FPT | 64 | Yes |
SMT | 64 | Yes |
When the memo block size is changed for an RDD, this setting is valid for database files that are created new. It is not possible to change the memo block size for existing databases.
See also: | DbInfo(), RddSetDefault(), Set() |
Category: | Database commands , SET commands |
Header: | Set.ch |
Source: | rtl\set.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example deonstrates changing the memo block size for a newly // created database #include "dbInfo.ch" REQUEST Dbfcdx PROCEDURE Main LOCAL aStruct RddSetDefault( "DBFCDX" ) USE Customer SHARED ALIAS Cust VIA "DBFCDX" aStruct := DbStruct() ? DbInfo( DBI_MEMOEXT ) // result: .fpt ? DbInfo( DBI_MEMOBLOCKSIZE ) // result: 64 SELECT 0 SET MEMOBLOCK TO 128 DbCreate( "Test.dbf", aStruct, "DBFCDX" ) USE TEST ? DbInfo( DBI_MEMOEXT ) // result: .fpt ? DbInfo( DBI_MEMOBLOCKSIZE ) // result: 128 CLOSE ALL RETURN
http://www.xHarbour.com