Panagiotis Sidiropoulos wrote:
--------------------------------
// READ MEMO FIELD
function spGetMEMOField( tTable: TDbf; cFieldName: string ): string;
var
   tsMemoStream: Tstream;
   pBuffer: pchar;
   sMemo: string;
begin
     tsMemoStream := TStream.Create;

This is a memory leak, plus you should never create TStreams anyway.

     tsMemoStream := TTable.CreateBlobStream( TTable.FieldByName(
cFieldName ), bmRead );
     tsMemoStream.Position := 0;
     pBuffer := GetMem( 200000 );

Better use tsMemoStream.Size instead of fixed size.

     tsMemoStream.read( pBuffer^, 200000 );

Dito.

     sMemo := strpas( pBuffer );

Besides this, I cannot really see why it would be slow. Do you have an example project plus dbf/dbt to test with ?

Micha

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to