Newsgroups : Borland : borland.public.delphi.rtl.win32 : 2008 Jan : How to clone an open array of const

www.cryer.info
Managed Newsgroup Archive

How to clone an open array of const

Subject:How to clone an open array of const
Posted by:"Chau Chee Yang" (c..@sql.com.my)
Date:Mon, 21 Jan 2008 23:05:58

Hi,

"array of const" is actually "array of TVarRec"

I want to store the "array of const" pass into function and store in a
variable and pass to others to process.  It seems very hard to do.  Does
anyone has good ways to do?

For example,

type
   TMyClass = class
   private
     FArray: array of TVarRec;
   public
     function KeepArray(const Arr: array of const);
   end;

procedure TMyClass.KeepArray(const Arr: array of const);
var i: integer;
begin
   SetLength(FArray, Length(Arr));
   for i := Low(Arr) to High(Arr) do
     FArray[i] := Arr[i];
end;


I may later use FArray for other purpose.  Is the above correct?

--
Best regards,
Chau Chee Yang

E Stream Software Sdn Bhd
URL: www.sql.com.my
SQL Financial Accounting

Replies:

www.cryer.info
Managed Newsgroup Archive