I've tried to use Move() instead of Copy(). Any objection with the following 
code?

var
  a: array of string;

SetLength(a, 5);
a[0] := 'aa'; a[1] := 'bb'; a[2] := 'cc'; a[3] := 'dd'; a[4] := 'ee';

System.Move(a[3], a[0], 2 * SizeOf(string) );    // instead of  a := Copy(a, 3, 
2);
SetLength(a, 2);



----- Original Message ----
From: dmitry boyarintsev <skalogryz.li...@gmail.com>
To: FPC-Pascal users discussions <fpc-pascal@lists.freepascal.org>
Sent: Wed, April 28, 2010 10:31:09 AM
Subject: Re: [fpc-pascal] Question about Deleting elements in Dynamic Array

On Wed, Apr 28, 2010 at 7:24 AM, Bihar Anwar <bihar_an...@rocketmail.com> wrote:
> Ok, I'll try to observe the compiled code using debugger and benchmark it if 
> needed. BTW, what do you mean by allocating memory directly? Is there another 
> way to allocate memory for dynamic array besides using SetLength()?

Copy() (from the existing dynamic array).
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



      
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to