Blitz (29/172)

From:Tony Rolfe
Date:8 Sep 2000 at 10:34:31
Subject:Re: ListViews

On Wed, 6 Sep 2000 18:42:13 -0700 Curt Esser said:
> Hi Neil,
>
> David is right, as usual. But he forgot to point out what I think is the
> real answer to your question, the part about Dim'ing the list.
>
> Lists are NOT treated the same as a standard array, so the normal method is
> to simply Dim the list to a value much larger than you ever expect to use,
> then add the items as needed.
>
> For example, if I was expecting to have a maximum of 50 ~ 100 items in a
> list, I would Dim it to say 2000, or so to be safe...
>
> The key point is that the list will NOT waste any memory on the unused
> items - it only sets aside the memory for each item when it is actually
> added to the list, whereas Dim'ing a standard array DOES set aside the
> entire memory for the number of items requested, right at the start.

Actually, that's not strictly true (At least I don't think it is).

DIM List Fred.Tyep(2000) actually allocates 2000 headers and the
actual data is allocated by the AddItem() call.



Tony Rolfe
Amiga 2000, 68030/25, 1+8Mb
www.shoalhaven.net.au/edgewater
ICQ #51271965

---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie