[futurebasic] Re: [FB] Re: Empty array resource

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 2002 : Group Archive : Group : All Groups

From: Alain Pastor <pixmix@...>
Date: Fri, 08 Nov 2002 01:15:19 +0100

Ken Shmidheiser wrote:

>> As a side note, you can increase dramatically the speed of the process
>> preallocating the dynamic array before entering the loop of death.
> 
> 
> How?
> 

Just assign a value to the higher item. If you know in advance that 
you will have to handle 230000 items, you can just write this:

gDynStrArray(230000) = ""

The handle is created or resized big enough in a single operation 
(memory permitted) to contain all the data, instead of numerous 
changes in size and possible moves in memory within the loop.
-- 
Cheers,

A. Pastor