Board index » delphi » VB : Redim Preserve in Delphi ?

VB : Redim Preserve in Delphi ?

I've been using Redim Preserve quite a lot in my VB apps that I'm now porting
to Delphi 3.
Are there anything similar in Delphi?
What would be the best way to rewrite it? Using some kind of pointers?

--
|| Bjorn K. Nilssen      // http://home.sn.no/~bjoernk/  // mainly 3D ||

 

Re:VB : Redim Preserve in Delphi ?


Quote
Bjorn-Kare Nilssen wrote:

> I've been using Redim Preserve quite a lot in my VB apps that I'm now porting
> to Delphi 3.
> Are there anything similar in Delphi?
> What would be the best way to rewrite it? Using some kind of pointers?

Look up ReAlloc in the online help.  Are you redim(ing) arrays?

Mark

Re:VB : Redim Preserve in Delphi ?


In article <3398E6D9.3...@interaccess.com>,

Quote
Mark Bracey <mbra...@interaccess.com> wrote:
>Bjorn-Kare Nilssen wrote:

>> I've been using Redim Preserve quite a lot in my VB apps that I'm now porting
>> to Delphi 3.
>> Are there anything similar in Delphi?
>> What would be the best way to rewrite it? Using some kind of pointers?

>Look up ReAlloc in the online help.  Are you redim(ing) arrays?

I only found ReAllocMem, but i guess that's the right one?
Yes, I'm redimming arrays. It was a convenient feature in VB, but I guess it's
better implemented using pointers in Delphi?

--
|| Bjorn K. Nilssen      // http://home.sn.no/~bjoernk/  // mainly 3D ||

Re:VB : Redim Preserve in Delphi ?


In article <Fn1lzgmCg8bD09...@sn.no>,
   bjoe...@sn.no (Bjorn-Kare Nilssen) wrote:

Quote
>I've been using Redim Preserve quite a lot in my VB apps that I'm now
porting
>to Delphi 3.
>Are there anything similar in Delphi?
>What would be the best way to rewrite it? Using some kind of pointers?

Variant arrays can be redimensioned non-destructively with the
VarArrayRedim procedure. Variant arrays are not much less efficient,
storage wise, than regular arrays of the same type. You can also declare
variant arrays of variants, if you want.

--
Brad Aisa     web archive: http://www.interlog.com/~baisa/
email (anti-spam encoded): baisa"AT SYMBOL"interlog.com

"The highest responsibility of philosophers is to serve as the
guardians and integrators of human knowledge."   -- Ayn Rand

Other Threads