xHarbour Reference Documentation > Command Reference xHarbour Developers Network  

SET MEMOBLOCK

Defines the default block size for memo files.

Syntax

SET MEMOBLOCK TO <nBlockSize>

Arguments

TO <nBlockSize>
<nBlockSize> is a numeric value defining the new memo block size.

Description

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 typeBlock sizeChangeable
DBT512No
FPT64Yes
SMT64Yes

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.

Info

See also:DbInfo(), RddSetDefault(), Set()
Category: Database commands , SET commands
Header:Set.ch
Source:rtl\set.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// 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

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe