<< Click to Display Table of Contents >> Navigation: Apollo VCL Components > Apollo VCL Component Reference > TApolloEnv > TApolloEnv Methods > SetMemoBlockSize |
Declaration
procedure SetMemoBlockSize( const Value: Integer );
Description
This method does not apply to CA-Clipper .DBT memo files, which use fixed 512 byte blocks.
The default .FPT memo block size is 32 bytes. The default .SMT memo block size is 1. This function sets a new default block size that will be used when creating any new table that has memos and will also change the block size in memo files when the DBF is packed. It does not affect existing memo files except when the corresponding DBF is packed.
Parameters
The new default block size. The size must be a value from 1 through 1024.
Delphi Example
// Create new FoxPro .DBF/.FPT using 1-byte memo blocks
procedure TForm1.Button1Click(Sender: TObject);
begin
with ApTbl do
begin
if not CreateNew( 'c:\Apollo\testnew.dbf', SDEFOX, 5 ) then
begin
ShowMessage( 'Create failed' );
Exit;
end;
// Must come after the call to CreateNew but before CreateExec
ApolloEnv1.SetMemoBlockSize( 1 );
CreateField( 'fchar', 'C', 25, 0 );
CreateField( 'fnum', 'N', 10, 2 );
CreateField( 'flog', 'L', 1, 0 );
CreateField( 'fdate', 'D', 8, 0 );
CreateField( 'fmemo', 'M', 10, 0 );
if CreateExec then
ShowMessage( 'Create succeeded' )
else
ShowMessage( 'Create failed' );
end;
end;
See Also